18 Oct 2023
03:12 AM
- last edited on
23 Oct 2023
07:58 AM
by
MaciejNeumann
Hi Team, We're planning to use dynatrace to do the API monitoring. I'm facing one issue - I'm able to call one API successfully with postman but failed with Dynatrace. Request url and http hearder and requestbody are all same. But I got error all the time from dynatrace. I checked the error as below:
The script setting as below:
Could anyone help to check why it often fail, please?
Solved! Go to Solution.
Hi,
You can see an entry about Troubleshooting HTTP Monitor Error/ Health Status Codes.
Are you sure header and payload in body are correct?
Best regards
I checked the headers and found the root cause is due to lack of one header. Thank you so much for the reminder!!
Perfect and welcome! 😎
Hi,
You are given the wrong Service name.
In the first step, use the API (GET entities list) to retrieve the list of services. Then use the name (entityId) of the service you want to use using the name that was returned after the API (it differs slightly from what you see in the GUI)
Example:
curl -L -X GET 'https://mySampleEnv.live.dynatrace.com/api/v2/entities?entitySelector=type(%22SERVICE%22),mzId(%2291...' \
-H 'Authorization: Api-Token xxx'
{ "totalCount": 52, "pageSize": 50, "nextPageKey": "AQArdHlwZSgiU0VSVklDRSIpL", "entities": [ { "entityId": "SERVICE-1125C375A187D27A","displayName": "dotNetBackend_easyTravel_x64", "lastSeenTms": 1590609632865, "properties": { "serviceTechnologyTypes": [ "IIS app pool", "ASP.NET", "DotNet" ] } },
Radek