How to use our RESTful API

​In this article, you are going to learn how to use our RESTful API services.
For this purpose, you have to find your Auth token from the My Account page.

Now let's see how exactly works the API. Visit our API builder page to build your call methods easily.

1. Get your Workbooks and Sheets

For getting all your workspaces you have to enter your Auth token, choose GET method, choose Workspaces object and choose Get action

By clicking the Send request button you will see the results on the right side of the builder. 

The first section is an example of how you can get this data by JavaScript code. Use it on your page if you want to display your workspace on your site. 

The second section is the result of the API. In the result you can see the structure of the result and if there is some kind of errors.

In the result we see that we have database with database ID 407 and database code 8mKa62Wluv1690434726.

2. Add row in your Sheet

The steps are similar to the previous API call.
This time you have to choose the POST method, then choose Database row object and Add action.

Now you will find two more fields - Database ID and Rows.
In Database ID you must enter the ID of the database you want to add rows. In Rows you need to enter the rows you want to add.

Click on the button Load example to load the example structure of the rows.


The example is already loaded and you can fill the values with your own.
For example, I have entered two rows with some data.


On posting this API call the result will be:


3. Get Sheet content

If you want to get your sheet content you have to use GET method with Object - Database, Action - Get Base content and your Sheet ID.

The API call is the following:

<script src="https://artavolo.com/modules/system/api/libraries/npm/node_modules/axios/dist/axios.min.js?v=1689751601"></script>
<script type="module">
    import {
        apiExec
    } from 'https://artavolo.com/api/rest.js';

    const integration = {
        url: 'https://artavolo.com/api/call',
        method: 'get',
        auth_token: 'ZGVtby1hcGlAYXJ0YXZvbG8uY29tOjE5ODk5OWZmZGFlZmQ2YmNhNzBlZmEyZWEwYWI3NWJmYzIxZWY3MjhmYmViZjA3ZDFhZmE4NGZkYjI1N2UzZTQyZTA3ZDlkOWZiMjZiZTljOWM5N2UxNTAyZDU4NjI4ZTBkYzVmODM2NDk3ODEzOThhYmFkNDE0YmNjNjZhNjlm'
    }

    const postData = {
        "database_id": "407"
    };

    const arg = {
        object: 'database',
        action: 'get-base-content',
        data: JSON.stringify(postData)
    };

    apiExec(integration, arg, function (response) {
        console.log(response.data);
    });

as result the server response will be:

{
    "response":"success",
    "scope":"database",
    "msg": {
        "content":"Your databases are generated successfully.",
        "type":"success",
        "scope":"database",
        "console":"Your databases are generated successfully."
    },
    "table_content": {
        "cnt_rows":10,
        "content":[{
            "row_id":"1",
            "parent_id":"0",
            "settings":null,
            "comments":null,
            "style":null,
            "history":null,
            "created_by":"151",
            "updated_by":null,
            "date_added":null,
            "last_updated":null,
            "dataFieldDefault1":null,
            "dataFieldDefault2":null,
            "dataFieldDefault3":null
        },
            {
                "row_id":"2",
                "parent_id":"0",
                "settings":null,
                "comments":null,
                "style":null,
                "history":null,
                "created_by":"151",
                "updated_by":null,
                "date_added":null,
                "last_updated":null,
                "dataFieldDefault1":null,
                "dataFieldDefault2":null,
                "dataFieldDefault3":null
            },
            {
                "row_id":"3",
                "parent_id":"0",
                "settings":null,
                "comments":null,
                "style":null,
                "history":null,
                "created_by":"151",
                "updated_by":null,
                "date_added":null,
                "last_updated":null,
                "dataFieldDefault1":null,
                "dataFieldDefault2":null,
                "dataFieldDefault3":null
            },
            {
                "row_id":"4",
                "parent_id":"0",
                "settings":null,
                "comments":null,
                "style":null,
                "history":null,
                "created_by":"151",
                "updated_by":null,
                "date_added":null,
                "last_updated":null,
                "dataFieldDefault1":null,
                "dataFieldDefault2":null,
                "dataFieldDefault3":null
            },
            {
                "row_id":"5",
                "parent_id":"0",
                "settings":null,
                "comments":null,
                "style":null,
                "history":null,
                "created_by":"151",
                "updated_by":null,
                "date_added":null,
                "last_updated":null,
                "dataFieldDefault1":null,
                "dataFieldDefault2":null,
                "dataFieldDefault3":null
            },
            {
                "row_id":"6",
                "parent_id":"0",
                "settings":null,
                "comments":null,
                "style":null,
                "history":null,
                "created_by":"151",
                "updated_by":null,
                "date_added":"2023-07-27 09:23:11",
                "last_updated":null,
                "dataFieldDefault1":"First row First column value",
                "dataFieldDefault2":"First row Second column value",
                "dataFieldDefault3":"toDo"
            },
            {
                "row_id":"7",
                "parent_id":"0",
                "settings":null,
                "comments":null,
                "style":null,
                "history":null,
                "created_by":"151",
                "updated_by":null,
                "date_added":"2023-07-27 09:23:11",
                "last_updated":null,
                "dataFieldDefault1":"Second row First column value",
                "dataFieldDefault2":"Second row Second column value",
                "dataFieldDefault3":"done"
            },
            {
                "row_id":"8",
                "parent_id":"0",
                "settings":null,
                "comments":null,
                "style":null,
                "history":null,
                "created_by":"151",
                "updated_by":null,
                "date_added":"2023-07-27 09:34:46",
                "last_updated":null,
                "dataFieldDefault1":"",
                "dataFieldDefault2":"",
                "dataFieldDefault3":""
            },
            {
                "row_id":"9",
                "parent_id":"0",
                "settings":null,
                "comments":null,
                "style":null,
                "history":null,
                "created_by":"151",
                "updated_by":null,
                "date_added":"2023-07-27 09:34:46",
                "last_updated":null,
                "dataFieldDefault1":"",
                "dataFieldDefault2":"",
                "dataFieldDefault3":""
            },
            {
                "row_id":"10",
                "parent_id":"0",
                "settings":null,
                "comments":null,
                "style":null,
                "history":null,
                "created_by":"151",
                "updated_by":null,
                "date_added":"2023-07-27 09:34:46",
                "last_updated":null,
                "dataFieldDefault1":"",
                "dataFieldDefault2":"",
                "dataFieldDefault3":""
            }]}}</script>

As you can see you have table_content property which contains two sub-properties - cnt_rows and content. cnt-rows contains the number of rows in the sheet and content is an array with all rows.

This three examples showing you how you can use the JavaScript integration code on your site.

In the API builder, you can find out all GET and POST call methods you need.