Create a Schedule to Export the Dashboard View using REST API
Bold BI dashboards provide a convenient feature that enables the scheduling of exports for specific views within a dashboard using REST API. This functionality is beneficial for sharing relevant insights with stakeholders without exporting the entire dashboard data.
This feature is available from version 7.9.27 onwards.
REST API for Obtaining an Access Token
Before making any changes, it is necessary to authenticate with the Bold BI server to obtain an access token. This token must be included in the header of all API requests to ensure they are authorized.
Option 1: Get the Access Token from UI (Supported from version 7.7.9
)
- Go to the “Profile” page.
- Navigate to the “PERSONAL ACCESS TOKEN” tab.
- Choose the “Token Expiration” from the drop-down and generate the token by clicking the “Generate Token” button.
Option 2: Get the Access Token from REST API
Authentication Endpoint
Field | Value |
---|---|
Self-Hosted Server URL | http://{domain}/bi/api/site/{sitename}/token |
Bold BI Cloud Server URL | http://{domain}/bi/api/token |
Method | POST |
Content-Type | application/json |
Request Body Schema
{
"username": "string",
"password": "string",
"grant_type": "password"
}
Sample Response
Get the view ID of the dashboard
Option 1: Get the View ID from UI
- Select the views icon on the header of the dashboard rendering page, hover the view item from the saved views list, and then click on the link icon to copy the view ID.
- Please refer to the screenshot below and note down the view ID from the copied link.
Option 2: Get the view ID from REST API
- Users who have created the views and users who have permission to access it can see the lists of views, Get Dashboard Views
Create a Schedule to Export the Dashboard View using REST API
You can create a schedule to export the dashboard view using REST API by following the details below.
API End Point:
Field | Value |
---|---|
Self-Hosted Server URL | https://{yourdomain}/bi/api/site/<site_identifier>/v5.0/dashboards/schedules |
Bold BI Cloud Server URL | https://{yourdomain}/bi/api/v5.0/dashboards/schedules |
Method | POST |
Content-Type | application/json |
Sample Request Body:
In the following sample request body, configure the Name, ItemId(Dashboard ID), DashboardViewID, UserList(recipient email) & schedule occurrence details as per your preference before sending the request. For more details, please refer to the REST API documentation on creating a new schedule to export the dashboard view.
{
"Name": "ScheduleViewViaAPI",
"Description": "schedule test view",
"ItemId": "61c419b3-0001-405e-b56d-f53bd36c3e90",
"DashboardViewId": "cf96799d-a8e3-42c7-9810-53809d1d42cd",
"ExportType": "csv",
"StartTime": "2024-07-12T05:40:00Z",
"NeverEnd": true,
"EndAfterOccurrence": 0,
"EndDate": "2024-08-25T15:44:00Z",
"UserList": [
"demo@boldbi.com"
],
"ScheduleType": "Hourly",
"IsEnabled": true,
"FailureNotificationToOwner": true,
"FailureNotificationToRecipient": true,
"FailureOccurrence": 0,
"ExportFormatInfo": {
"Size": "A4",
"Orientation": "Landscape",
"Extension": "csv",
"Resolution": 100
},
"Email": {
"Subject": "Mail through API",
"Body": "Schedule dashboard is ScheduleApi"
},
"HourlySchedule": {
"ScheduleInterval": "00:15"
},
"DailySchedule": {
"RecurrenceType": "string",
"EveryNdays": 0,
"EveryWeekday": true
},
"WeeklySchedule": {
"RecurrenceWeeks": 0,
"RecurrenceDays": [
"string"
]
},
"MonthlySchedule": {
"RecurrenceType": "string",
"DayRecurrence": {
"DayInterval": 0,
"MonthInterval": 0
},
"CustomRecurrence": {
"WeekOfMonth": "string",
"DayOfWeek": "string",
"MonthInterval": 0
}
},
"YearlySchedule": {
"YearInterval": 0,
"RecurrenceType": "string",
"MonthRecurrence": {
"MonthOfYear": "string",
"DayOfMonth": 0
},
"CustomRecurrence": {
"WeekOfMonth": "string",
"DayOfWeek": "string",
"MonthOfYear": "string"
}
}
}
Sample Response
Manage schedules
You can manage the created schedule in the schedule listing page from Bold BI.