Where do dashboard block IDs come from?

I’m looking through the dashboard POST API, and I notice that each dashboard block needs an ID (I’ve also observed their IDs in the network traffic to my browser). I’d like to use the Dashboard API to create a copy of an existing dashboard, with the only change being updated device IDs, so I plan to take the dashboard JSON, tweak it, and POST it to a new dashboard.

It looks like all of the needed functionality is reachable through the API, but I’m not sure if the dashboard block IDs need to be globally unique, or generated by the server, etc. I wasn’t able to track down where they’re generated.

Thanks!

Dashboard block ids just need to be unique within the context of the dashboard - so if you are just copying the JSON to create an entirely new dashboard, you don’t actually need to change those ids at all. They are currently generated by the front end web app when creating blocks (although the api will validate that they are in fact unique within a dashboard).

We do have plans to eventually document the detailed contents of dashboard block JSON configuration (much of it is probably pretty obvious, though, if you have been inspecting the JSON manually). But until we do get that documentation written, feel free to ask any other questions about it here!

1 Like