New Relic REST API for alert not displaying alert condition

curl -X GET ‘https://api.newrelic.com/v2/alerts_conditions.json’ -H ‘X-Api-Key:XXXXXX’ -i -G -d ‘policy_id=XXXXX’ is not displaying the condition information am I doing something wrong on this end ?

HTTP/1.1 200 OK
Proxied-By: Service Gateway
Content-Security-Policy: frame-ancestors *.newrelic.com
Cache-Control: max-age=0, private, must-revalidate
Content-Length: 17
Content-Type: application/json
Date: Thu, 17 Dec 2020 19:46:17 GMT
Etag: “4d1c3c9c493ecd15c7040145d575e8e6”
Link: https://api.newrelic.com/v2/alerts_conditions.json?page=0&policy_id=XXXX; rel=“last”
Server: nginx
Status: 200 OK
X-Rack-Cache: miss
X-Request-Id: 58de0984d141ee15f589fc3485259663
X-Runtime: 0.172121
X-Ua-Compatible: IE=Edge,chrome=1
Vary: Accept-Encoding

{“conditions”:[]}

$ curl -X GET ‘https://api.newrelic.com/v2/alerts_conditions.json’ -H ‘X-Api-Key:XXXX’ -i -G -d ‘policy_id=XXXX’
HTTP/1.1 200 OK
Proxied-By: Service Gateway
Content-Security-Policy: frame-ancestors *.newrelic.com
Cache-Control: max-age=0, private, must-revalidate
Content-Length: 17
Content-Type: application/json
Date: Thu, 17 Dec 2020 19:58:20 GMT
Etag: “XXXXXX”
Link: https://api.newrelic.com/v2/alerts_conditions.json?page=0&policy_id=XXXX; rel=“last”
Server: nginx
Status: 200 OK
X-Rack-Cache: miss
X-Request-Id: f85d5276815298fc44468f39cbc22829
X-Runtime: 0.160170
X-Ua-Compatible: IE=Edge,chrome=1
Vary: Accept-Encoding

{“conditions”:[]}

Hi there @rajesh.tupakula -

If I understand you correctly you are trying to use the API to list the conditions associated with your alerts policies.

I wanted to check a one thing with you. First, you are using the correct CURL command for returning conditions on internal services. If you are trying to get conditions on alerts for EXTERNAL services, it’s slightly different and documented here:

https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/rest-api-alerts/rest-api-calls-alerts#ext-services-conditions

Let me know if this does not get you pointed in the right direction.