Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Find all of the Service ID's for Opsgenie

Doug Garcia May 22, 2023

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!

 

1 answer

1 accepted

0 votes
Answer accepted
John M
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 22, 2023

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:

2023-05-22_17-03-57.png

Doug Garcia May 23, 2023

Duh... thanks a ton John.  That did what I needed.  So appreciate the answer.

Like John M likes this
Wei Wung
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 23, 2023

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events