21 Nov 2022
04:49 AM
- last edited on
21 Nov 2022
08:08 AM
by
MaciejNeumann
I am trying to get all entities using this api call
https://{your-environment-id}.live.dynatrace.com/api/v2/entities
Let me know why i am getting this error
But this gives me error
Solved! Go to Solution.
21 Nov 2022 11:54 AM
Doing this in one API call is not possible as you must specify the entitySelector parameter for this API call, if you do not have a next-page-key defined.
Getting all entities would require you to first query all possible types with
https://{your-environment-id}.live.dynatrace.com/api/v2/entityTypes
and query https://{your-environment-id}.live.dynatrace.com/api/v2/entities?entitySelector=type("your-type") with each type you get back from the entityTypes endpoint.
For reference:
https://www.dynatrace.com/support/help/dynatrace-api/environment-api/entity-v2/get-all-entity-types
https://www.dynatrace.com/support/help/dynatrace-api/environment-api/entity-v2/entity-selector