Workspace APIs
Get a dashboard as tiles
Read a workspace dashboard back as the same tile list you create one with.
GET
curl "https://api.usedatabrain.com/api/v2/workspace/dashboard?workspaceName=Customer%20analytics&dashboardId=sales-overview" \ --header "Authorization: Bearer $DATABRAIN_SERVICE_TOKEN"Auth
A service token only. See Authentication.
ServiceTokenheader
AuthorizationBearer <token>A service token. A data app API token is refused.
Query
The workspace, up to 200 characters.
The dashboard's externalDashboardId or its UUID.
Dashboards that a customer made in an embed are not returned.
Response
{ "schemaVersion": 1, "title": "Sales overview", "layout": { "columns": 24 }, "dashboardId": "4e5f6a7b-8c9d-4e0f-a1b2-c3d4e5f6a7b8", "externalDashboardId": "sales-overview", "tiles": [ { "id": "revenue-by-month", "kind": "databrain-chart", "title": "Revenue by month", "position": { "x": 0, "y": 0, "w": 12, "h": 8 }, "chart": { "type": "line", "metricRef": "b3c4d5e6-f7a8-4b9c-8d0e-1f2a3b4c5d6e", "chartOptions": {} } } ]}The fields are those of Create a dashboard from tiles. A tile whose metric or datasource is gone has "unavailable": true and a reason.
Errors
Errors have only a message: { "error": { "message": "..." } }.
| Status | Why |
|---|---|
| 400 | dashboardId must be a dashboard UUID or slug. |
| 403 | You used a data app API token |
| 404 | Dashboard not found or identifier is ambiguous. |
| 409 | The dashboard cannot be shown as a tile list |
| 500 | Dashboard read failed. |
For errors that every endpoint returns, see Authentication.
curl -X GET 'https://api.usedatabrain.com/api/v2/workspace/dashboard?workspaceName=string&dashboardId=string'Example Response
{ "schemaVersion": 1, "title": "Sales overview", "layout": { "columns": 24 }, "tiles": [ { "id": "revenue-by-month", "kind": "databrain-chart", "title": "Revenue by month", "position": { "x": 0, "y": 0, "w": 12, "h": 8 }, "chart": { "type": "line", "metricRef": "b3c4d5e6-f7a8-4b9c-8d0e-1f2a3b4c5d6e", "query": "SELECT month, SUM(amount) AS revenue FROM orders GROUP BY month", "companyIntegrationId": "6f1c2b9e-4d3a-4f8e-9b7c-2a1d0e5f6c7b", "chartOptions": {} } } ], "dashboardId": "4e5f6a7b-8c9d-4e0f-a1b2-c3d4e5f6a7b8", "externalDashboardId": "sales-overview"}