It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

opsgenie alert-api Edited

From opsgenie alert-api, I am trying to get the alerts list for a particular team for last week Monday 8am to current week's Monday 8 am.

Can some one help me modify this query pls

response = requests.get('https://api.opsgenie.com/v2/alerts?query=createdAt%3A2019-04-29T08:00:00&teams=Site reliability&sort=createdAt&order=desc', headers=headers)

Appreciate  the help

1 answer

1 accepted

0 votes
Answer accepted

Hi there,

 

Thanks to contact with Opsgenie. You can use the following query:

https://api.opsgenie.com/v2/alerts?query=createdAt>1557129600+AND+createdAt<1557734400+AND+teams="Site reliability"&sort=createdAt&order=asc

 

For the time format we are using UNIX time stamp. And if you are searching for multiple queries "+AND+" should be used between them. (1557129600 for 06-05-2019 08.00.00 and 1557734400 for 13-06-2019 08.00.00)

 

Hope this helps to your API request. Best regards,

Thanks for the help!

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Opsgenie

What’s New in Opsgenie October 2019

Hi there, we have a lot of exciting announcements this month, specifically around Dark Mode. You don’t want to miss out!    Dark Mode for Mobile App is here! A few weeks ago, we annou...

586 views 3 13
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you