Data Retrieval
Download a dashboard as PDF
Render an embedded dashboard for one customer as a PDF file.
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.pdfAuth
A data app API token, or a service token. With a service token, dataAppId picks the data app. See Authentication.
ApiTokenAuthorizationBearer <token>A service token or a data app API token.
Body
The data app id. With a data app API token it must be that token's data app.
The embed id.
The embed's dashboard id. This picks the dashboard.
The tenant whose data is shown.
Multi-datasource workspaces: the datasource.
Multi-datamart workspaces: the datamart.
Page size and table limits of the PDF.
5 fields in pageSetup
One of landscape, portrait. Page orientation.
One of auto, one-up, two-up. Charts per row.
One of paginate, all. Split long tables over pages, or show all rows.
Response
The PDF file, with Content-Type: application/pdf.
Errors
| Status | error.code | Why |
|---|---|---|
| 400 | INVALID_REQUEST_BODY | A field is missing or wrong |
| 400 | INVALID_DASHBOARD_ID | No embed of the data app has this dashboard |
| 400 | DATASOURCE_NAME_ERROR or DATAMART_NAME_ERROR | The name is unknown |
| 403 | DATA_APP_ID_ERROR | dataAppId is not the data app of your API token |
| 404 | DATA_APP_NOT_FOUND | No data app in your organization has this id |
| 500 | INTERNAL_SERVER_ERROR | The PDF could not be made |
For errors that every endpoint returns, see Authentication.
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" }}'"<binary PDF>"