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

Any Opsgenie api's to get list of alerts based on the time range

Ashok Simma November 29, 2022

I'm trying to query the Opsgenie python API based on time range but I don't see any API that supports the action.

1 answer

1 accepted

2 votes
Answer accepted
Nick H
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 30, 2022

Hi @Ashok Simma ,

Not a Python expert myself, but this is possible via the alert API using something like Postman - so I have to assume it should be possible with Python as well.

You can query between date ranges. For example if you wanted to pull alerts created in the month of November, you might use something like this:

https://api.opsgenie.com/v2/alerts?query=createdAt%3E31-10-2022%20AND%20createdAt%3C01-12-2022

queryapi1.jpg

 

I typically use a site like URL Encoder to help, but not sure what the Python format / query might be. I'm not sure if any of that helps, but again leads me to believe it should be possible.

Ashok Simma December 1, 2022

Hi @Nick H  thank you for the reply. its working for me

Like Nick H likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events