07 Mar 2024 10:44 AM - last edited on 29 Jul 2024 10:50 AM by Michal_Gebacki
Hello,
I am working on a requirement to an trigger automated on demand synthetic execution via powershell, invoke method works perfectly fine but I am struggling with request body where I need to change the "monitor id" based on a variable.
Rest API request invoke body
{
"failOnPerformanceIssue": false,
"monitors": [
{
"executionCount": 1,
"monitorId": "SYNTHETIC_TEST-0200ECC670458A61",
"repeatMode": "SEQUENTIAL"
}
],
"processingMode": "STANDARD",
"takeScreenshotsOnSuccess": true
}
Invoke-RestMethod -Uri "https://{environmentid}.live.dynatrace.com/api/v2/synthetic/executions/batch" -Method Post -Body $json -Headers $headers
Any suggestions/solutions will help
07 Mar 2024 01:21 PM
Hi,
I understand do you need use a template of body, and in your script set previously the value of monitorID.
07 Mar 2024 02:16 PM
Hello Miguel,
In the POST API request body, i want to input the synthetic ID dynamically instead of static value