Overview

The Databrain API provides endpoints for retrieving dashboards and metrics from data apps in both cloud Databrain and self-hosted Databrain environments.

API Endpoints

Cloud Databrain Endpoint

POST https://api.usedatabrain.com/api/v2/dataApp/dashboards

Self-hosted Databrain Endpoint

POST <SELF_HOSTED_URL>/api/v2/dataApp/dashboards

Headers

Authorization
string
required
Bearer API TOKEN

API Methods

Fetch Dashboards by datapp

Endpoint:
POST /dashboards
Request Body:
{
  "isPagination": "boolean (optional)",
  "pageNumber": "number (optional)"
}
Response:
{
  "data": [
    {
      "name": "string",
      "externalDashboardId": "string"
    }
  ],
  "error": null
}
Error Response:
400 -Error
{
  "error": {
    "code": "string",
    "message": "string",
    "status": 400
  }
}

Fetch Metrics by embed and client

Endpoint:
POST /metrics
Request Body:
{
  "embedId": "string",
  "clientId": "string",
  "isPagination": "boolean (optional)",
  "pageNumber": "number (optional)"
}
Response:
{
  "data": [
    {
      "name": "string",
      "metricId": "string"
    }
  ],
  "error": null
}
Error Response:
400 -Error
{
  "error": {
    "code": "string",
    "message": "string",
    "status": 400
  }
}

Error Codes

  • INVALID_DATA_APP_API_KEY: Invalid or missing Data App API Key
  • INVALID_REQUEST_BODY: Required fields missing or wrong type
  • EMBED_PARAM_ERROR: Embed ID not found or mismatched with API Key

Validation Schema

The request body must conform to the following schema:
  • embedid (required): embedId of the data app; embedID .
  • clientid (required): client id.
  • isPagination (optional): Boolean flag to enable pagination.
  • pageNumber (optional): Page number when pagination is enabled.

Example Use Cases

Fetching Dashboards

Request
{
  "isPagination": true,
  "pageNumber": 2
}
Response
{
  "data": [
    {
      "name": "Dashboard 1",
      "externalDashboardId": "12345"
    },
    {
      "name": "Dashboard 2",
      "externalDashboardId": "67890"
    }
  ],
  "error": null
}

Fetch Metrics by embed and client

Endpoint:
POST /metrics
Request Body:
{
  "embedId": "string",
  "clientId": "string",
  "isPagination": "boolean (optional)",
  "pageNumber": "number (optional)"
}
Response:
{
  "data": [
    {
      "name": "string",
      "metricId": "string"
    }
  ],
  "error": null
}
Error Response:
400 -Error
{
  "error": {
    "code": "string",
    "message": "string",
    "status": 400
  }
}

Error Codes

  • INVALID_DATA_APP_API_KEY: Invalid or missing Data App API Key
  • INVALID_REQUEST_BODY: Required fields missing or wrong type
  • EMBED_PARAM_ERROR: Embed ID not found or mismatched with API Key

Validation Schema

The request body must conform to the following schema:
  • embedId (required): embedId of the data app; embedID
  • clientId (required): client id.
  • isPagination (optional): Boolean flag to enable pagination.
  • pageNumber (optional): Page number when pagination is enabled.

Example Use Cases

Fetching Metrics by embed Id and client

Request:
{
  "embedId": "FinanceWorkspace",
  "clientId": "98765",
  "isPagination": true,
  "pageNumber": 1
}
Response:
{
  "data": [
    {
      "name": "Revenue Metric",
      "metricId": "r123"
    },
    {
      "name": "Expense Metric",
      "metricId": "e456"
    }
  ],
  "error": null
}