REST APIs
Overview
This section explains how to integrate Data Blaze with external systems through its REST API. It covers authentication, secure communication setup, and seamless interaction with third-party applications.
Token-based authentication
Data Blaze REST APIs use a token-based system. Within your space, you can create one or more tokens to connect to the REST APIs. You can also choose what each token is allowed to do, like creating, reading, updating, or deleting data at the table level.
When you send a request to the REST API, add your space token in the Authorization
header as a token. All API requests must be sent over HTTPS for security.
Creating an API token
- Open the space you want to create an API token for.
- Click the three dots next to the space name, and then click the "API tokens" menu item.
- The API tokens dialog will open.
- Click the "Create token" button, and enter a name for your token, then click the "Create" button.
- The token is created and now listed in the tokens dialog.
- Click the "copy" button next to your created token.
Now you can paste and use the token wherever you need it.
Table permissions
To have fine-grained control over your data, you can customize the permissions per table for your token, like creating, reading, updating, or deleting data.
- Click the "Show tables" link below your token.
- Now you can see all the tables in your space with the option to customize their permissions for that token.
More token actions
- Click the three dots next to the token name.
- You’ll see options to generate a new API token, rename the token, or delete it.
API-docs
Data Blaze automatically generates an API documentation page for each space, based on the tables and fields that are in that space.
To access the API documentation page for a space:
- Open the space you want to create an API token for.
- Click the three dots next to the space name, and then click the "API documentation" menu item.
- You'll be redirected to the API documentation page, in a new browser tab.
- In the right panel, you can copy a sample request for each endpoint using one of the following clients: "cURL", "HTTP", "JavaScript (axios)", and "Python (requests)".
- After copying the request sample, replace the
"YOUR_SPACE_TOKEN"
with the token you copied in the previous section.
Endpoints Summary
The table below summarizes the Data Blaze API endpoints, which are described in detail on your space's “API Documentation” page.
# | Endpoint | Description |
---|---|---|
1 | GET /api/database/fields/table/{table_id}/ | List fields in a table. |
2 | GET /api/database/rows/table/{table_id}/ | List rows in a table. |
3 | GET /api/database/rows/table/{table_id}/{row_id}/ | Get details of a specific row. |
4 | POST /api/database/rows/table/{table_id}/ | Create a new row in a table. |
5 | PATCH /api/database/rows/table/{table_id}/{row_id}/ | Update a specific row. |
6 | PATCH /api/database/rows/table/{table_id}/{row_id}/move/ | Move a specific row. |
7 | DELETE /api/database/rows/table/{table_id}/{row_id}/ | Delete a specific row. |
8 | GET /api/database/tables/all-tables/ | List all the tables that the token has either create, read, update or delete access to. |
9 | POST /api/database/{space_id}/query/ | Use SQL to run SELECT, INSERT, UPDATE, and DELETE queries on a table. |