Generating a token
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.
Go to the
- Scroll down to the
Enable API access.
You'll get a generated API token. This token will be used to identify you while connecting to the Vertabelo API.
Note that you may
Disable API accesshere (and enable it again to get a new token).
The Vertabelo API functionality is simple and straightforward and consists of two functions.
Fetch a database model as an XML file:
or the version with a specific tag:
Fetch SQL code that creates database tables and other entities:
or the version with specific tag:
The Vertabelo API is a typical REST service. The API token must be passed as a user name with the password for your account.
For the API to work, you'll need to know the identifier of the model you want to fetch. The identifier can be found, after selecting the model, in the
Details tab in the right panel:
To make this examples legible, we'll put our token, password, and model ID into the variables:
read -s -p "Token:" TOKEN ; echo; \ read -s -p "Password:" PASSWORD; echo; \ read -s -p "Model ID:" MODEL_ID; echo; \
You may copy all the shell scripts here right away, and try it yourself in your terminal –
read will prompt you for the data.
Here is an example of how to fetch SQL from the command line:
curl \ -u $TOKEN:$PASSWORD \ https://my.vertabelo.com/api/sql/$MODEL_ID \ > model-create-database.sql
Getting the XML definition of the model is similar:
curl \ -u $TOKEN:$PASSWORD \ 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'd like to get access to other Vertabelo features, our support service is waiting for your ideas.