API

Authentication

First, get an API Token as follows:

  • Go to Devisto and click in the upper right corner on the account icon and choose API Tokens.
  • Click Create Token. A message box will appear with the new token. Select the token and copy it.

Next, include the following header in all your API requests, and replace <api-token> by the token you copied:

Authorization: Bearer <api-token>

Projects

All Projects

To get all projects you have access to, execute the following request:

GET https://api.devisto.com/projects

Sample response:

[
  {
    "id": 1,
    "uuid": "fe0a5aed-6277-4d2b-85c9-d48b01149f2c",
    "name": "Project 1",
    "slug": "project1",
    "url": "project1.devisto.com"
  },
  {
    "id": 2,
    "uuid": "2fcdc530-1069-4f80-925c-9c41efe0edff",
    "name": "Project 2",
    "slug": "project2",
    "url": "project2.devisto.com"
  }
]

One Project

To get the details of one specific project, you can execute the following request:

GET https://api.devisto.com/projects/<project-id>

Sample response:

{
  "id": 1,
  "uuid": "fe0a5aed-6277-4d2b-85c9-d48b01149f2c",
  "name": "Project 1",
  "slug": "project1",
  "url": "project1.devisto.com"
}

Table Groups

All Table Groups

Tables in Devisto are organized in groups. To get a tree-like structure of table groups and tables, use the following request:

GET https://api.devisto.com/projects/<project-id>/table-groups

Sample response:

[
  {
    "id": 3,
    "name": "Projects",
    "order": 1,
    "tables": [
      {
        "id": 7,
        "group_id": 3,
        "name": "Projects",
        "slug": "projects",
        ...
      }
    ]
  }
]

One Table Group

To get the details of only one table group, use the following request:

GET https://api.devisto.com/projects/<project-id>/table-groups/<table-group-id>

Sample response:

{
  "id": 3,
  "name": "Projects",
  "order": 1,
  "tables": [
    {
      "id": 7,
      "group_id": 3,
      "name": "Projects",
      "slug": "projects",
      ...
    }
  ]
}

Tables

All Tables

To get a flat list of all the tables in a project, execute the following request:

GET https://api.devisto.com/projects/<project-id>/tables

Sample response:

[
  {
    "id": 7,
    "group_id": 3,
    "name": "Projects",
    "slug": "projects",
    ...
  }
]

One Table

To get the details of only one table group, use the following request:

GET https://api.devisto.com/projects/<project-id>/tables/<table-id>

Sample response:

{
  "id": 7,
  "group_id": 3,
  "name": "Projects",
  "slug": "projects",
  ...
}

Entries

All Entries

To get all entries from a specific table, use the following request:

GET https://api.devisto.com/projects/<project-id>/tables/<table-id>/entries

Some things to note about the response:

  • The results are paginated. To get all entries, request the next_page_url as long as it's included in the response.
  • Translatable fields will contain an object with the languages as keys. See slug in the sample response below.
  • All asset and relation fields will be expanded and included as full objects (or as a list of objects when the fields are 'multiple'). See overview_image in the sample response below.
{
  "from": 1,
  "to": 100,
  "current_page": 1,
  "last_page": 3,
  "per_page": 100,
  "total": 239,
  "first_page_url": "https://api.devisto.com/projects/17/tables/7/entries?page=1",
  "last_page_url": "https://api.devisto.com/projects/17/tables/7/entries?page=3",
  "prev_page_url": null,
  "next_page_url": "https://api.devisto.com/projects/17/tables/7/entries?page=2",
  "data": [
    {
      "id": 1,
      "title": "First item",
      "intro_text": "<p>Text</p>",
      "slug": {
        "en": "first-item",
        "nl": "eerste-item"
      },
      "overview_image": {
        "id": 65,
        "uuid": "1f54939a-fe4e-4e5f-a59a-9ed436299644",
        "folder_id": 0,
        "name": "Picture 1.jpg",
        "path": "1f54939a-fe4e-4e5f-a59a-9ed436299644.jpg",
        "type": "image",
        "mime_type": "image/jpeg",
        "size": 1505295,
        "width": 2000,
        "height": 2000,
        "extension": "jpg",
        "url": "https://project1.devisto.com/assets/1f54939a-fe4e-4e5f-a59a-9ed436299644.jpg"
      }
    },
    ...
  ]
}

One Entry

To get the details of only one specific entry, use the following request:

GET https://api.devisto.com/projects/<project-id>/tables/<table-id>/entries/<entry-id>

Sample response:

{
  "id": 1,
  "title": "First item",
  "intro_text": "<p>Text</p>",
  "slug": {
    "en": "first-item",
    "nl": "eerste-item"
  },
  "overview_image": {
    "id": 65,
    "uuid": "1f54939a-fe4e-4e5f-a59a-9ed436299644",
    "folder_id": 0,
    "name": "Picture 1.jpg",
    "path": "1f54939a-fe4e-4e5f-a59a-9ed436299644.jpg",
    "type": "image",
    "mime_type": "image/jpeg",
    "size": 1505295,
    "width": 2000,
    "height": 2000,
    "extension": "jpg",
    "url": "https://project1.devisto.com/assets/1f54939a-fe4e-4e5f-a59a-9ed436299644.jpg"
  }
}
Previous topic
← Authentication