In the get incidents API, if you use `since` parameter, then the API ignores the service ID params.

rest-api
(Shobhit Gupta) #1

In the get incidents API, if you use since parameter, then the API ignores the service ID params.

If I query with a since parameter, I end up getting all sorts of incidents since that date. My service ID filters are ignored.

(Thomas Roach) #2

Could you please send us the API request you’re making, so we can look over why this might be occurring?

(Shobhit Gupta) #3

Hi Tom,
I don’t know how to share details since I can’t share my API key.

But this is what the API url looks like:
https://api.pagerduty.com/incidents?serviceIds[]=PHM7I0G&serviceIds[]=PCT97LP&limit=50&offset=0&since=2019-04-18T16:12:52.039Z

But if you inspect the response, then this is what you see:

> response.incidents.map(i => i.service.id)

(6) ["P05S1BN", "PAZ3SV4", "P5IX87X", "P5RZCF7", "P5RZCF7", "P8TYV6H"]

As you see its returning incidents from various services other than the two requested PHM7I0G and PCT97LP.

-Shobhit

(Shobhit Gupta) #4

Oh wow. Actually figured it out.
My parameter is wrong. It should be service_ids instead of serviceIds.

This issue is resolved. Thanks.

(Malcolm Konner) #5

Hi Shobhit,

I was just trying to reproduce when I saw this comment. Thank you for letting us know! I am glad to hear that it’s behaving as you’d expect now

(system) closed #6

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.