Embedding API
Fetch dashboards by workspace
List the dashboards of a workspace with the ids you need to embed them.
POST
curl --request POST https://api.usedatabrain.com/api/v2/workspace/dashboards \ --header "Authorization: Bearer $DATABRAIN_SERVICE_TOKEN" \ --header "Content-Type: application/json" \ --data '{ "workspaceName": "Customer analytics", "isPagination": true, "pageNumber": 1 }'Auth
A service token. See Authentication.
ApiTokenheader
AuthorizationBearer <token>A service token or a data app API token.
Body
The workspace.
isPaginationboolean
true returns 10 dashboards per page. Send a JSON boolean: the string "false" turns paging on.
pageNumbernumber
Page, from 1
Response
{ "data": [ { "id": "4e5f6a7b-8c9d-4e0f-a1b2-c3d4e5f6a7b8", "name": "Sales overview", "externalDashboardId": "sales-overview" } ]}| Field | Description |
|---|---|
externalDashboardId | The id to use as dashboardId in embeds and other dashboard calls |
id | Internal id |
name | Dashboard name |
The list includes dashboards your customers made. The order is not fixed.
Errors
| Status | error.code | Why |
|---|---|---|
| 400 | INVALID_REQUEST_BODY | workspaceName is missing, or a field is unknown |
| 400 | WORKSPACE_ID_ERROR | No workspace has this name |
For errors that every endpoint returns, see Authentication.
Next, create an embed for a dashboard.
curl -X POST 'https://api.usedatabrain.com/api/v2/workspace/dashboards' \ -H 'Content-Type: application/json' \ -d '{ "workspaceName": "Customer analytics", "isPagination": true, "pageNumber": 1}'Example Response
{ "data": [ { "id": "4e5f6a7b-8c9d-4e0f-a1b2-c3d4e5f6a7b8", "name": "Sales overview", "externalDashboardId": "sales-overview" } ]}