Articles in this section
Category / Section

Download Dashboards Using REST API

Published:
Bold BI has the support to download and upload the dashboards along with their associated data sources. This article explains on how to download dashboards from the Bold BI tenant site using the REST API.

For that, we have below items to be considered when using the download API:
  • Collect dashboard details to download,
  • Prepare dashboard files to download, and
  • Download prepared dashboard files.
We can see each item one by one, as follows.

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

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

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.

  • The default page size is 25.
  • The page size's maximum value is 100.
Example: page_size= 10
page 
It indicates which set of dashboards to be taken based on the above described page size.
  • The default page is 1.
Example: page=1
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.

Allowed ValueDefinition
+ascending
-descending

Default sorting is descending based on modified date.

Example: sort=+

exclude_multitabdashboardExcludes multi-tab dashboards to fetch.
Allowed Value
Definition
true
True
excludes multi-tab dashboards
false
False
includes multi-tab dashboards
If needs multi-tab dashboard, ignore this because default value is false.

Example: exclude_multitabdashboard = true
Sample Request URL with All Query Parameter: http://localhost:64398/bi/api/site/site1/v5.0/dashboards?serverPath=/sales&page_size=10&page=1&q=sales&sort=+&exclude_multitabdashboard=true
Sample Request
img1 - Copy.pngSample 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 codeDescriptionError Message
204NoContentItems not Found
400BadRequestPage does not exists
401UnAuthorizedAccess denied
405MethodNotAllowedRequest 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.

Embed BI URL: {domain_name}/bi/api/site/{site_identifier}/v5.0/dashboards/download/job

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 NameDefinition
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.

  • Values allowed are true, false
  • Default value is true.

Response sample
{
    "ApiStatus": true,
    "Data": {
        "JobId": 9
    },
    "Status": true,
    "StatusMessage": "Download job has been initiated for the given dashboards."
}

Download Prepared Dashboard Files

Once the dashboards are prepared using below API, we can download it as a byte array, for more details, refer to the document Download Dashboard - REST API. For that, we need to use the job id which was received in the above prepare dashboard file API response field name JobId.

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


Path parameter
Parameter NameDefinition
jobIdDownload Job ID
Sample URL: http://localhost:60870/bi/api/site/site1/v5.0/dashboards/download/job/3
How to know dashboard is prepared to download
The dashboard file content will be received from the field named ItemContent as a byte array if the job is completed, and it can be identified using the field named JobStatus.

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.

Response sample for completed download
{
"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

For failed downloads, the reason for the failure will be shared for each item as a list, in the ErrorMessage field under the FailedDownload as shown below, it will help us to resolve the failure items. If it remains unresolved, contact us by creating support ticket by sharing the failure reason details.
{
  "ApiStatus": true,
  "Data": {
    "JobStatus": "string",
    "ItemContent": "string",
    "ItemExtension": "string",
    "FailedDownload": [
      {
        "DashboardId": "string",
        "ProgressJson": [
          {
            "Stage": 0,
            "Label": "string",
            "Status": "string",
            "ErrorMessage": "string"
          }
        ]
      }
    ]
  },
  "Status": true
}

Related Links

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
AA
Written by Amrutha Asokan
Updated:
Comments (0)
Please  to leave a comment
Access denied
Access denied