Download Dashboards Using REST API
- Collect dashboard details to download,
- Prepare dashboard files to download, and
- Download prepared dashboard files.
Collect Dashboard Details to Download
Users who have read permission access to the dashboards can get those list of dashboards details like dashboard ID, name, etc. using below API, for more details, refer to the document Get Dashboards – REST API
Embed BI URL: {domain_name}/bi/api/site/{site_identifier}/v5.0/dashboards
Query Parameters
Parameter | Value | ||||||
---|---|---|---|---|---|---|---|
serverPath | If needed the dashboards details of particular category, then provide the category name like below; otherwise, ignore this Example: /sales | ||||||
page_size | It denotes the number of dashboards to be taken per page.
Example: page_size= 10 | ||||||
page | It indicates which set of dashboards to be taken based on the above described page size.
| ||||||
q | Search and fetch particular dashboard sets. Provided keyword will search dashboard name, description, its category name, and created user's display name. Example: q=sales | ||||||
sort | Dashboard list to be sorted based on its name.
Default sorting is descending based on modified date. Example: sort=+ | ||||||
exclude_multitabdashboard | Excludes multi-tab dashboards to fetch.
If needs multi-tab dashboard, ignore this because default value is false. Example: exclude_multitabdashboard = true |
Sample Request
Sample Response
{
"Data": [
{
"CanRead": true,
"CanWrite": true,
"CanDelete": true,
"CanDownload": true,
"CanSchedule": true,
"CanOpen": true,
"CanMove": true,
"CanCopy": true,
"CanClone": true,
"CanCreateItem": false,
"Id": "04964147-7605-4702-9105-bfc0279d7f86",
"ItemType": "Dashboard",
"Name": "Sales Analysis Dashboard",
"Description": "This dashboard visualizes data that provides a quick and easy way to monitor and analyze sales performance. It displays the key performance indicators (KPIs): total sales, total orders, total products, sales by channel, top 5 countries by sales, top 5 products sold, total orders by shipping mode, top 5 companies by sales, and product details. These metrics help sales teams and management to track progress toward sales goals, identify areas for improvement, and make informed decisions based on data.",
"CreatedById": 1,
"CreatedByDisplayName": "Amrutha Asokan",
"ModifiedById": 1,
"ModifiedByFullName": "Amrutha Asokan",
"CategoryId": "ea81fdea-971b-4fd9-bdd8-498a129e6ca7",
"CategoryName": "Sales",
"CreatedDate": "08/17/2023 06:14 PM",
"ModifiedDate": "08/17/2023 06:14 PM",
"ItemModifiedDate": "2023-08-17T18:14:03",
"ItemCreatedDate": "2023-08-17T18:14:03",
"IsMultiDashboard": false,
"IsFavorite": false,
"IsPublic": false,
"IsLocked": false,
"EmbedUrl": "http://localhost:64398/bi/site/site1/dashboards/04964147-7605-4702-9105-bfc0279d7f86/Sales/Sales Analysis Dashboard?isembed=True",
"IsUnlisted": false
}
],
"TotalResults": 1,
"Links": [
{
"Link": "http://localhost:64398/bi/api/site/site1/v4.0/dashboards?serverPath=%2fsales&page=1&page_size=25",
"Rel": "first",
"Type": "GET"
},
{
"Link": "http://localhost:64398/bi/api/site/site1/v4.0/dashboards?serverPath=%2fsales&page=1&page_size=25",
"Rel": "last",
"Type": "GET"
}
]
}
Error Message
HTTP status code | Description | Error Message |
---|---|---|
204 | NoContent | Items not Found |
400 | BadRequest | Page does not exists |
401 | UnAuthorized | Access denied |
405 | MethodNotAllowed | Request type was not GET |
Prepare Dashboard Files to Download
From the above collected dashboard detail list, we can get the dashboard IDs from the field name Id to prepare the dashboard files to download using below API, for more details, refer to the document Prepare Dashboard for Download – REST API. Users who have read and download permission access to the dashboards can download the dashboards.
HTTP Method: Post
Authorization: bearer<access_token>
To generate access token, refer to the document How to generate access token to authenticate users | Bold BI Docs
Request Body Schema
{
"DashboardId": [
"string"
],
"CanIncludeSensitiveInformation": true
}
Parameter Name | Definition |
---|---|
DashboardId | We can provide list of dashboard IDs to download in single time |
CanIncludeSensitiveInformation | Include all sensitive information in an encrypted format. This will be helpful if you want to upload the dashboard into another site without any data source credential changes.
|
Response sample
{
"ApiStatus": true,
"Data": {
"JobId": 9
},
"Status": true,
"StatusMessage": "Download job has been initiated for the given dashboards."
}
Download Prepared Dashboard Files
Embed BI URL: {domain_name}/bi/api/site/{site_identifier}/v5.0/dashboards/download/job/{jobId}
HTTP Method: Get
Authorization: bearer<access_token>
To generate access token, refer to the document How to generate access token to authenticate users | Bold BI Docs
Parameter Name | Definition |
---|---|
jobId | Download Job ID |
How to know dashboard is prepared to download
Job Status | Description |
---|---|
Started | Multiple jobs are in queue to the download dashboards. Based on the queue, next job will be initiated once current InProgress job gets completed. |
InProgress | Dashboard files are preparing to download. |
Completed | Dashboard file is prepared and ready to download. |
Failed | Dashboard file preparation failed, and we can find the reason for the failure in the object FailedDownload. Added more details for this case below. |
Note
- If the job is in "Started" or "InProgress" status, you can regularly monitor using this API till its completion. Once the job completed, you can get the dashboard file from ItemContent.
- For single dashboard download, the dashboard file will be in the extension ".bbix" as a byte array, whereas bulk dashboards will be downloaded in zip file as a byte array by combining all the individual bbix dashboard files, which can be identified using the field named ItemExtension in the response.
{
"ApiStatus": true,
"Data": {
"JobStatus": "Completed",
"ItemContent": "UEsDBBQAAAAIABuXEVfNA1kk4eEHAB6lDQAjAAAARmluYW5jaWFsIE1hbmFnZW1lbnQgRGFzaGJvYXJkLmJiaXjsvYty27iyNvoqrJz918zsRDYJgCA5u1adku92fIvlS5KZ+adAALRpy5IjSr5NzV/+1t6A0g9Ro5ceuXIdHDKTeqfhFXyF1Hnzj//53qGuiCW7Pk9ji7zWZvw1KW5w2/PF/u+fU3sBZ+Qvv+FEvP//As4m0SSll//vf0A4dr8gKjlc/yA0GR5rP+0I8C7YSiCdV/X//+u//+o9/SeEr/Nd/lm2e//f//T//H1BLAQIUABQAAAAIABuXEVfNA1kk4eEHAB6lDQAjAAAAAAAAAAAAAAAAAAAAAABGaW5hbmNpYWwgTWFuYWdlbWVudCBEYXNoYm9hcmQuYmJpeFBLAQIUABQAAAAIABuXEVfjVFuvM2oBAAI+BQAdAAAAAAAAAAAAAAAAACLiBwBIUiBSZWNydWl0bWVudCBEYXNoYm9hcmQuYmJpeFBLBQYAAAAAAgACAJwAAACQTAkAAAA=",
"ItemExtension": ".zip"
},
"Status": true
}
Response schema for failed download
{
"ApiStatus": true,
"Data": {
"JobStatus": "string",
"ItemContent": "string",
"ItemExtension": "string",
"FailedDownload": [
{
"DashboardId": "string",
"ProgressJson": [
{
"Stage": 0,
"Label": "string",
"Status": "string",
"ErrorMessage": "string"
}
]
}
]
},
"Status": true
}