You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I have been requested to create a Dashboard that displays the status of our Key infrastructure objects. I am trying to utilize the Opsgenie REST API to obtain a list of open alerts within a saved search. However, in Postman, when I try this, I don't get any results in the Body. I'm not sure if I am doing this correctly.
The GET URL I am using is:
https://api.opsgenie.com/v2/alerts?query="status: open"&searchIdentifier="Meraki - network has become unreachable"&searchIdentifierType=id&offset=0&limit=20&sort=createdAt&order=desc
Thank you for any help on this one,
This is Arumugam from Atlassian support and I'm happy to help!
I understand that you are working with our APIs and not getting the expected results.
While looking at the query you constructed, it seems that the query is not URI encoded.
Please follow the steps below to get the results:
1. Go to your Opsgenie instance list view page and construct the search query in UI and search for alerts and see if it is fetching the results that you want.
2. Once you have the search query, now you can use that from Postman or any programming language. However, you would need to URI encode the search parameter before appending it to the API endpoint.
Here is a sample CURL request of how it should be for your reference:
curl -XGET -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889" 'https://api.opsgenie.com/v2/alerts?query=status%3Aopen&offset=7&limit=10&sort=createdAt&order=desc'
Kindly try the same an let me know how it goes.