Hi,

We're using Superset to create customer dashboards, and we'd like to
automate the creation process using the REST API.
I'd like to create a template dashboard that contains style/layout info and
specifies chart locations.
When I create a customer-specific dashboard, I would use that template but
specify customer-specific charts.

This is the process I've been trying:
Using the API, I've been able to create the datasets and charts, but I'm
having trouble creating customer-specific dashboards.
I've created a main 'template' dashboard that contains all the CSS, rows,
columns and charts we'd like to see in a dashboard.
I then call GET /dashboard/pk to retrieve the values to use in a following
call to create a new dashboard, which is based on my 'template' dashboard.
When sending a POST to the /dashboard/ URI, I'm providing values for "css",
"dashboard_title", "owners", "published", "roles" and "slug", and they work
fine.
My problem is how to provide useful values for the "json_metadata" and
"position_json" fields.
The primary difficulty is that all the charts that I've added to the
'template' dashboard get values like "CHART-xxxxxxx" and UUID values
embedded into both the "json_metadata" and "position_json" fields, which
makes a simple find/replace operation non-trivial.

If, using the above process, I create a new dashboard, then make a call to
PUT /chart/pk and include the dashboard pk in the dashboard field's array,
it does add the chart to the dashboard, but it's at the bottom and outside
all the positioning elements.

I need a way to create a new chart and assign it to a specific position on
a new dashboard.  Is there a way to do that? Or would you recommend a
different approach?


Thanks,
Bob

Reply via email to