How to remove a Dashboard from a Embedded Application view page
When embedding the Bold BI dashboard into your application, you may need to remove dashboards from the view page or delete them permanently from the Bold BI server. This article provides guidance on how to achieve both using the JavaScript API and the REST API.
Removing Dashboard from the Dashboard View
To remove a dashboard from the dashboard view within your application, you can utilize the JavaScript API provided by Bold BI. The destroy()
method is specifically designed for this purpose.
Using the destroy()
Method
The destroy()
method will remove the dashboard and all of its associated elements from the page that is currently being viewed. Here’s how you can use it:
var instance = BoldBI.getInstance("container"); //container -> embed container id
instance.destroy();
For more details on the destroy()
method, please refer to the Embedding API Reference.
Permanently Deleting a Dashboard from the Bold BI Server through embedded application
If your requirement is to permanently delete a dashboard from the Bold BI server, you will need to use the REST API. It is important to note that once a dashboard is deleted using the REST API, it cannot be restored.
Using the REST API to Delete a Dashboard
To delete a dashboard permanently, you can make a DELETE request to the Bold BI server API. Here is an example of how to do this:
URL for Bold BI Onpremise Server: https://{yourdomain}/bi/api/site/<site_identifier>/v5.0/dashboards/{dashboardId}
URL for Bold BI Cloud Server: https://{yourdomain}/bi/api/v5.0/dashboards/{dashboardId}
Request type: DELETE
Header parameter: Authorization: bearer {your_access_token}
Replace {yourdomain}
with your Bold BI application domain, {dashboardId}
with the ID of the dashboard you wish to delete and {your_access_token}
with your valid access token.
For more information on the REST API and the delete operation, visit the Server API Reference.
Conclusion
Whether you need to temporarily remove a dashboard from view or permanently delete it from the server, Bold BI provides the necessary APIs to accomplish these tasks. Remember to use these features with caution, especially when permanently deleting data.