How to run Dynatrace monitors via its API POST request and validate the results via API.

--

First, for Authorization, you need an API token, example=666
In headers,
Add it as Api-Token 666
Content-Type=application/json

In the body, pass the below payload , here SYNTHETIC_TEST-777 means my monitorId, this can be retrieved from GUI of Dynatrace.

{
"monitors": [
{
"monitorId": "SYNTHETIC_TEST-777"
}
]
}

In the post request, URI should be like below.

https://myinstancedynatrace.com/api/v2/synthetic/executions/batch

Once you send this will you will get a response, here there are tow locations.

Using “batchId”: “6603785377452758322”, of above response we can send a get request.

https://myinstancedynatrace.com/api/v2/synthetic/executions/batch/6603785377452758322

We could validate the “batchStatus”,”failedCount”,”failedToExecuteCount”and “triggeringProblemsCount” to check the execution status of the Synthetic monitor.

--

--

No responses yet