I have an interesting question. My team is kind of Service crazy for Opsgenie, we have over 20 of them and might create more in the future. Even though I can apparently add as many Services as I want in Opsgenie itself, I also have a python script I use to requires the ID as part of the automation. I've been able to use Reqbin to run a curl command utilizing the syntax for the List command found here (https://docs.opsgenie.com/docs/service-api) with our API key to view these.
My problem is that there appears to be a max number of services I can view now (20). So I can see all the applicable information for Services that were existing, but anything new I can't. The only workaround I have is to delete an existing Service and a new on appears. The Services are definitely saved in Opsgenie and available in the drop down menu, but I also need the ID so I can just my scripts. Does anyone have an idea what to do here? Maybe a different API tool? I don't see a way to change any settings in Reqbin and unless I'm missing something, there's no easy way to see what the ID is directly from Opsgenie > Settings or Services.
Thank you!
Hi @Doug Garcia ,
The list services API does limit to 20 services by default but you can get up to 100 by changing the 'limit' parameter. Here is what that looks like:
https://api.opsgenie.com/v1/services?limit=100
You can also see the service ID in the URL bar from the service's page:
Duh... thanks a ton John. That did what I needed. So appreciate the answer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
just to add to what John shared, if you more than a page of responses, you can use pagination to view the next page of responses.
For example, this will give you the next set of 100 if there are more than 100 services:
https://api.opsgenie.com/v1/services?offset=100&limit=100
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.