Skip to Content

Workspace APIs

Get a dashboard as tiles

Read a workspace dashboard back as the same tile list you create one with.

GET
/api/v2/workspace/dashboard
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.

Authorization

ServiceToken
headerAuthorizationBearer <token>

A service token. A data app API token is refused.

Query

workspaceNamestringrequired

The workspace, up to 200 characters.

dashboardIdstringrequired

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": "..." } }.

StatusWhy
400dashboardId must be a dashboard UUID or slug.
403You used a data app API token
404Dashboard not found or identifier is ambiguous.
409The dashboard cannot be shown as a tile list
500Dashboard read failed.

For errors that every endpoint returns, see Authentication.

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