We've added an API to our Vertabelo application to help you incorporate some automation into your build system. Here is a short instruction on how to use the Vertabelo API.
First of all, you have to enable access to the API. You'll need have at least a "Basic" account plan or be a member of a company.
- 1. From the User menu, go to the "My account" page
- Scroll down to the "Settings" section
- Click "Enable API access"
- 4. You'll get a generated API token. This token will be used to identify you while connecting to the Vertabelo API.
The Vertabelo API functionality is simple and straightforward, and consists of two functions.
- Fetch a database model as an XML file: https://my.vertabelo.com/api/xml/MODEL_ID
or the version with specific tag: https://my.vertabelo.com/api/xml/MODEL_ID/TAG_NAME
- Fetch SQL code that creates database tables and other entities: https://my.vertabelo.com/api/sql/MODEL_ID
or the version with specific tag: https://my.vertabelo.com/api/sql/MODEL_ID/TAG_NAME
The Vertabelo API is a typical REST service. The API token must be passed as a user name while the password is an empty string.
For the API to work, you'll need to know the identifier of the model you want to fetch. The identifier can be found on the "Model details" page of your database model:Here is an example of how to fetch SQL from the command line:
VERTABELO_API_TOKEN=put-your-api-token-here MODEL_ID=put-your-model-identifier-here curl -u $VERTABELO_API_TOKEN: \ https://my.vertabelo.com/api/sql/$MODEL_ID > create-database.sqlGetting the XML definition of the model is similar:
VERTABELO_API_TOKEN=put-your-api-token-here MODEL_ID=put-your-model-identifier-here curl -u $VERTABELO_API_TOKEN: \ https://my.vertabelo.com/api/xml/$MODEL_ID > model.xml
As you can see, accessing the Vertabelo API is as simple as an HTTP request. If you wish, we can publish a Vertabelo API client in your favorite technology.
If you’d like to get access to other Vertabelo features, our support service is waiting for your ideas.