Vertabelo API

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. 1. From the User menu, go to the "My account" page
  2. Scroll down to the "Settings" section
  3. Click "Enable API access"
  4. 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.

  1. 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
  2. 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.sql
Getting 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.

Rafał Strzaliński 27th August 2014
 
 

Try our online database modeler. No registration. No commitments.

 
 
Tags
 
Subscribe to our newsletter

If you find this article useful, join our weekly newsletter to be notified about the latest posts.