Hi, I am trying to fetch all entities as mentioned on official documentation https://{environmentid}.live.dynatrace.com/api/v2/entities
and getting response:
{“error”: {“code”: 400,“message”: “Constraints violated.”,“constraintViolations”: [{“path”: “entitySelector”,“message”: “must be set if next-page-key is not defined”,“parameterLocation”: “QUERY”,“location”: null}]}}Kindly help in clarifying where I am wrong and how to fetch all entities?Thanks
Hi,
I think you are missing entitySelector:
curl -X 'GET' \
'https://XXXXXXXXXX.live.dynatrace.com/api/v2/entities?entitySelector=type%28%22HOST%22%29' \
-H 'accept: application/json; charset=utf-8' \
-H 'Authorization: Api-Token XXXXXXXXXX'
Best regards
This only gets HOST entities, not all entities. Shouldn’t there be like a wildcard to use to include all entities?
@Khalid_Alkhouli , no the Dynatrace Classic API requires an entityType. You can loop through the available entities using get entity types API and fetch those entity per type. It’s not possible to return multiple entity types in one query.