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

How to fetch all entities

mango_byte
Visitor

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
1 REPLY 1

AntonPineiro
DynaMight Guru
DynaMight Guru

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

❤️ Emacs ❤️ Vim ❤️ Bash ❤️ Perl

Featured Posts