Category / Section
How to Publish a Custom Widget Using Bold BI REST API
Published:
This article explains how to add or publish the custom widget using API calls in Bold BI On-Premises using Postman.
Authorization
To execute this action, please ensure that a access token is included in your request header. For details on obtaining the access token, please refer to the relevant documentation here.
Authorization: bearer <token>
Publish a Custom Widget Using Bold BI REST API
Follow these steps to create a custom widget using API calls:
- Use the below endpoint in postman with POST method
http(s)://{your host}:{your port number}/bi/api/site/{your_site_identifier}/v4.0/custom-widget
- Then add the token generated from the ‘token’ endpoint above in the Headers with key as ‘Authorization’ and value as ‘bearer {Your_token}’
- The custom widgets folder should be structured as follows:
- Create a new Folder and rename it as CustomWidget
- Copy and paste the custom widgets inside the folder as shown in below image
- Zip the CustomWidget folder.
- Convert the CustomWidget.zip file to a base64 string using any online tools.
- Include the following parameters in the body of the request in JSON format.
{ "FileContent": "Place the Converted custom widget’s base64 string value here" }
- Click Send. On successful request the custom widget will be created and can be found under Settings > Widgets .
Response
- 200 OK - Provided custom widgets published successfully.
- 400 Bad Request - Invalid Body syntax - Connector name or Connection JSON is invalid or Empty.
- 401 Unauthorized - Authorization toke is invalid, or token has expired.
- 409 Conflict - Connector name already exists.
Reference