cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Dashboard update through API

pawelzak
New Contributor III

Hi,

I would like to create / update dashboard definition based on the json file. How can one do it? I tried the following:

databricks api post /api/2.0/preview/sql/dashboards/$dashboard_id --json @file.json

 

 

But it does not update the widgets...

How can this be solved, I need to be able to create / update the dashboards programatically

Regards,

Pawel

3 REPLIES 3

Gamlet
New Contributor II

To programmatically create/update dashboards in Databricks using a JSON file, you can use the Databricks REST API's workspace/export and workspace/import endpoints. Generate a JSON representation of your dashboard using workspace/export, modify it as needed, and then use workspace/import to update or create the dashboard with the modified JSON definition.

Best wishes, Zpak

pawelzak
New Contributor III

Hi Zpak,

Could you please elaborate? I can not export the dashboard, the following error is returned:
Request: databricks api get /api/2.0/workspace/export --json '{"path": "/Shared/t1"}'
Error: "Error: dbsqlDashboard is not user-facing."

Thanks,

Pawel

Kaniz_Fatma
Community Manager
Community Manager

Thank you for posting your question in our community! We are happy to assist you.

To help us provide you with the most accurate information, could you please take a moment to review the responses and select the one that best answers your question?

This will also help other community members who may have similar questions in the future. Thank you for your participation and let us know if you need any further assistance! 
 

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!