cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get all entities giving me error

gurulakshman
Newcomer

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

{
"error": {
"code": 400,
"message": "Constraints violated.",
"constraintViolations": [
{
"path": "entitySelector",
"message": "must be set if next-page-key is not defined",
"parameterLocation": "QUERY",
"location": null
}
]
}
}
1 REPLY 1

dt_martin
Dynatrace Enthusiast
Dynatrace Enthusiast


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


Featured Posts