Embedding API
Fetch metrics by dashboard
List the metrics on one dashboard of a workspace.
POST
curl --request POST https://api.usedatabrain.com/api/v2/workspace/dashboard/metrics \ --header "Authorization: Bearer $DATABRAIN_SERVICE_TOKEN" \ --header "Content-Type: application/json" \ --data '{ "workspaceName": "Customer analytics", "dashboardId": "sales-overview" }'Auth
A service token. See Authentication.
ApiTokenheader
AuthorizationBearer <token>A service token or a data app API token.
Body
The workspace.
The dashboard's externalDashboardId, from Fetch dashboards by workspace
isPaginationboolean
true returns 10 metrics per page. Send a JSON boolean.
pageNumbernumber
Page, from 1
Response
{ "data": [ { "name": "Monthly revenue", "metricId": "b3c4d5e6-f7a8-4b9c-8d0e-1f2a3b4c5d6e" } ]}Archived and deleted metrics are left out. Metrics added to a customer dashboard are in the list. The order is not fixed.
Errors
| Status | error.code | Why |
|---|---|---|
| 400 | INVALID_REQUEST_BODY | A field is missing or unknown |
| 400 | WORKSPACE_ID_ERROR | No workspace has this name |
| 400 | DASHBOARD_PARAM_ERROR | No dashboard in this workspace has this id |
For errors that every endpoint returns, see Authentication.
curl -X POST 'https://api.usedatabrain.com/api/v2/workspace/dashboard/metrics' \ -H 'Content-Type: application/json' \ -d '{ "workspaceName": "Customer analytics", "dashboardId": "sales-overview"}'Example Response
{ "data": [ { "name": "Monthly revenue", "metricId": "b3c4d5e6-f7a8-4b9c-8d0e-1f2a3b4c5d6e" } ]}