Skip to Content

Embedding API

Fetch dashboards by workspace

List the dashboards of a workspace with the ids you need to embed them.

POST
/api/v2/workspace/dashboards
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.

Authorization

ApiToken
headerAuthorizationBearer <token>

A service token or a data app API token.

Body

workspaceNamestringrequired

The workspace.

true returns 10 dashboards per page. Send a JSON boolean: the string "false" turns paging on.

Page, from 1

Response

{  "data": [    {      "id": "4e5f6a7b-8c9d-4e0f-a1b2-c3d4e5f6a7b8",      "name": "Sales overview",      "externalDashboardId": "sales-overview"    }  ]}
FieldDescription
externalDashboardIdThe id to use as dashboardId in embeds and other dashboard calls
idInternal id
nameDashboard name

The list includes dashboards your customers made. The order is not fixed.

Errors

Statuserror.codeWhy
400INVALID_REQUEST_BODYworkspaceName is missing, or a field is unknown
400WORKSPACE_ID_ERRORNo workspace has this name

For errors that every endpoint returns, see Authentication.

Next, create an embed for a dashboard.

Example Request
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"    }  ]}