Fetching full dashboard definitions efficiently
The issue: Fetching full dashboard definitions efficiently.
- /api/v1/dashboards?expand=widgets returns full definitions but can't be filtered by OIDs.
- /api/v1/dashboards/{dashboardId}?expand=widgets allows per-dashboard retrieval but requires Admin role for full data, which seems like a defect.
- /api/v1/dashboards/{dashboardId} + /api/v1/dashboards/{dashboardId}/widgets might work but requires merging results, which we’d like to avoid.
Is there a way to retrieve full dashboard definitions in a single call for a filtered list of OIDs? Also, could /dashboards/export be a viable alternative?
merrittMelker
Posted 1 year ago·Last reply 1 year ago
3 comments
DRay
·1 year agoHello @merrittMelker ,
I’m following up to see if the solution offered by @steve worked for you.
If so, please click the 'Accept as Solution' button on the appropriate post. That way other users with the same questions can find the answer. If not, please let us know so that we can continue to help.
Thank you.
DRay
·1 year agoHello merrittMelker ,
I’m following up to see if the solution offered by steve worked for you.
If so, please click the 'Accept as Solution' button on the appropriate post. That way other users with the same questions can find the answer. If not, please let us know so that we can continue to help.
Thank you.
Steve Lewis
·1 year agoHi merrittMelkerÂ
I think the 3rd option in your list may be your best shot. This is how we do it inside Compose SDK e.g useGetDashboardModelÂ
In terms of network traffic efficiency, on the first call you may also include a fields list so only the ones you need for using in your code are returned e.g. /api/v1/dashboards/{dashboardId}?fields=oid,title,datasource,filters
Hope that helps
Steve