cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
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
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! 
 

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.