When pulling down data the results I get indicate the test ID but I don't know how to convert these into th etest name in human readable form.
That is, if I get a result like
I'd prefer to get the result with the actual name rather than SYNTHETIC_TEST-0000000000014AZ0. Of even download a reference of test names and their IDs.
I hope that makes sense, not 100% sure on the correct terminology.
Solved! Go to Solution.
Hi @Lisa S.!
You can get the monitor name using our Dynatrace APIs by either fetching a list of all monitors on your environment - https://www.dynatrace.com/support/help/extend-dynatrace/dynatrace-api/environment-api/synthetic/synt... - that contains both the synthetic test IDs and their names, or you could get more information about a single monitor by using GET monitor call - https://www.dynatrace.com/support/help/extend-dynatrace/dynatrace-api/environment-api/synthetic/synt... .
What is the outcome of GET /monitor - https://www.dynatrace.com/support/help/extend-dynatrace/dynatrace-api/environment-api/synthetic/synt... if you provide SYNTHETIC_TEST-0000000000014AZ0 as the monitor ID that you mentioned in the ticket? The response from GET /monitors would suggest that either the token you were using to authenticate doesn't allow you to access the monitors or that the filters that you added in the call were too restrictive.
I tried using the api explorer to build the curl syntax and ended up with:
curl -get -x www-cache.ourdomain.com:80 "https://SaaSID.live.dynatrace.com/api/v1/synthetic/monitors?api-token=ABCDEFG12345--ays&tag=chrome"
I just used that monitor as an example. Basically I want just build a list that matches all the monitor IDs with their names (would canonical be the right word here?). That I would use to substitute the ID with the name in Excel when I send out the report.
The other option if I can figure it out is when pulling down a load of metrics, for the name rather than the ID to be returned from the query in the first place.
Sorry if these are silly questions, I'm basically an absolute beginner here.
Aha - that's done it! It'd be more useful to be able to just pull out the 18 names/IDs I need for this report (tagged chrome). The API explorer did have a tag input, but from what I can see v1 explorer doesn't construct URLs with the auth token, so I improvised. Surely there must be a way to have both the token and the tag in the URL?
It should work, however it might be useful to check if tag shouldn't be upper case - it depends on how the tag itself was created. The endpoints are case sensitive so it might be good to experiment a bit.
The API explorer uses header-based auth which is possible to set up in curl as well using `--header` parameter as shown here - https://www.dynatrace.com/support/help/extend-dynatrace/dynatrace-api/basics/dynatrace-api-authentic...