Skip to Content

Embedding API

Fetch metrics by dashboard

List the metrics on one dashboard of a workspace.

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

Authorization

ApiToken
headerAuthorizationBearer <token>

A service token or a data app API token.

Body

workspaceNamestringrequired

The workspace.

dashboardIdstringrequired

The dashboard's externalDashboardId, from Fetch dashboards by workspace

true returns 10 metrics per page. Send a JSON boolean.

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

Statuserror.codeWhy
400INVALID_REQUEST_BODYA field is missing or unknown
400WORKSPACE_ID_ERRORNo workspace has this name
400DASHBOARD_PARAM_ERRORNo dashboard in this workspace has this id

For errors that every endpoint returns, see Authentication.

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