Create New Dashboards via API

I’m missing an API to create/share new Dashboards (non-classic).
Is this really missing or is it just not documented?

Dashboards are one of the most essential assets still. So I can’t believe there is no API for that?

If I recall correctly the Dashboards are using the Document Service, so the share document are actually there.

I think an improvement in Dashboard API or Documentation actually worth it, since I cross with it when working with the Doc Service for another reason.

It’s carefully hidden. But it’s there as a document service.

@r_weber btw. it’s also possible to use Monaco with it, just it’s still hidden under a feature flag. Also if you run into strange HTTP codes such as 409, your documents are deleted but not permanently deleted. You need to delete them permanently or restore them

Jesus! WHY???

Acknowledge that we can improve the visibility!

Where would you expect it to show up?
(it might seem like a naive question at this point, but I intentionally try not to bias here and ask an open-ended question).

@zietho first of all please add it to the docs.dynatrace.com in the API section. There is no single mention of the API URL in docs or developer.dynatrace.com.

Also please improve the API doc and include all response codes at least. I was desperately looking at response status codes and the API response did not have any text description either.

I think developer.dynatrace.com is ok if someone wants to build apps with NodeJS/Typescript. But honestly that’s not what I’d go to look for in the first place.
If I’m used to play/test with Postman or any custom code (python, …) then I’d expect a swagger or proper API documentation (here) and please re-introduce the easily accessible swagger link directly from the new Dynatrace UI! :wink:
And a plus: maybe even provide a postman collection and keep it up-to-date :wink:

Thank you for the swift and thorough reply!

regards

Thomas

Thanks Thomas!
That link is golden!

Hi @r_weber did you manage then to upload a dashboard via api? I’m stuck at binarizing the dashboard json in javascript, can you help? Thanks

Hi @paolo_fumanelli, you can do something like this to create a Blob from your dashboard json (at least in TypeScript):

export function jsonToBlob(json: unknown): Blob {
    return new Blob([JSON.stringify(json)], { type: 'application/json' });
}

Thank you! It worked perfectly