Skip to Content

Data Retrieval

Download a dashboard as PDF

Render an embedded dashboard for one customer as a PDF file.

POST
/api/v2/data-app/getDashboardPdf
curl --request POST https://api.usedatabrain.com/api/v2/data-app/getDashboardPdf \  --header "Authorization: Bearer $DATABRAIN_API_TOKEN" \  --header "Content-Type: application/json" \  --data '{    "dataAppId": "7c8d9e0f-1a2b-4c3d-8e4f-5a6b7c8d9e0f",    "embedId": "sales-overview",    "dashboardId": "sales-overview",    "clientId": "acme",    "pageSetup": { "orientation": "landscape" }  }' \  --output sales-overview.pdf

Auth

A data app API token, or a service token. With a service token, dataAppId picks the data app. See Authentication.

Authorization

ApiToken
headerAuthorizationBearer <token>

A service token or a data app API token.

Body

dataAppIdstringrequired

The data app id. With a data app API token it must be that token's data app.

embedIdstringrequired

The embed id.

dashboardIdstringrequired

The embed's dashboard id. This picks the dashboard.

clientIdstringrequired

The tenant whose data is shown.

Multi-datasource workspaces: the datasource.

Multi-datamart workspaces: the datamart.

pageSetupobject

Page size and table limits of the PDF.

5 fields in pageSetup

One of landscape, portrait. Page orientation.

densitystring

One of auto, one-up, two-up. Charts per row.

tableModestring

One of paginate, all. Split long tables over pages, or show all rows.

One of integer from 0. Rows per table.

Range: 0 to

One of integer from 1. Most rows in the whole file.

Range: 1 to

Response

The PDF file, with Content-Type: application/pdf.

Errors

Statuserror.codeWhy
400INVALID_REQUEST_BODYA field is missing or wrong
400INVALID_DASHBOARD_IDNo embed of the data app has this dashboard
400DATASOURCE_NAME_ERROR or DATAMART_NAME_ERRORThe name is unknown
403DATA_APP_ID_ERRORdataAppId is not the data app of your API token
404DATA_APP_NOT_FOUNDNo data app in your organization has this id
500INTERNAL_SERVER_ERRORThe PDF could not be made

For errors that every endpoint returns, see Authentication.

Example Request
curl -X POST 'https://api.usedatabrain.com/api/v2/data-app/getDashboardPdf' \  -H 'Content-Type: application/json' \  -d '{  "dataAppId": "7c8d9e0f-1a2b-4c3d-8e4f-5a6b7c8d9e0f",  "embedId": "sales-overview",  "dashboardId": "sales-overview",  "clientId": "acme",  "pageSetup": {    "orientation": "landscape"  }}'
Example Response
"<binary PDF>"