AlertsAPI Endpoint

rest-api

(Daniel) #1

Hello,

I am making a request against the incidents/{id}/alarms endpoint. Sadly, I get this error code: {“error”:{“message”:“Not Found”,“code”:2100}}

The incidents/{id} returns to me the appropriate incident, and it includes in it a block
“alert_counts”: {
“all”: 1,
“triggered”: 0,
“resolved”: 1
},

THe UI also indicates that an alert exists.

Am I missing something here? it seems like I don’t understand alarms: I would have expected to get back an array of length 1 with the alarm of interest in it when making the incidents/{id}/alarms request.

However, I just get back that 2100 not found error.

Guidance here would be appreciated. If it helps I am on the BASIC plan.

THanks,
Daniel


(Jade Paoletta) #2

Hi Daniel,

It sounds like the endpoint you would want to call is /incidents/{id}/alerts rather than incidents/{id}/alarms.

For a list of our REST API endpoints, you can check our our docs here: https://api-reference.pagerduty.com/#!/Incidents/get_incidents_id_alerts

Hope this helps - let me know if you have any other questions!


(Daniel) #3

Damn sorry that was a typo: I am hitting alerts

As in incidents/{id}/alerts

and getting the behavior indicated above.

The docs don’t say anything about the 2100 error: just not_found, which seems erroneous since it’s literally documented in the api


(Daniel) #4

NVM I figured it out: when you say ID in the docs you are referring to the capitalized 5 letter string, instead of the incident number.

IMO the API should not respond to requests to /incidents/{incident-number} with the same result as /incidents/{id}

It is extremely misleading that the former works but /incidents/{incident-number}/alerts does not.


(Jade Paoletta) #5

Hi Daniel,

Glad you were able to figure that out.

Also, I can certainly see your point about having the option to enter the id or number for one endpoint but not the other - I’ll go ahead and bring this feedback to our Product team.

Thanks!