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

Alert creation via REST API

Santhosh Parepu
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 20, 2020

I am trying to create an alert via REST API. I am getting 202 response during alert creation and receiving response payload as mentioned in the API document. But, I don't see alert getting created in Opsgenie. I am stuck at this step and couldn't proceed further. Did any one face this problem?

2 answers

1 accepted

0 votes
Answer accepted
Amit Kumar
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 20, 2020

The 202 should have been returned with a Request ID. You can use the Request Status API endpoint with that ID to get the information on how the request was processed.

https://docs.opsgenie.com/docs/alert-api#get-request-status.

1 vote
Nick H
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 20, 2020

Hi @Santhosh Parepu 

A 202 typically means "The request is valid and will be processed asynchronously.
Unlike 200, it does not guarantee that the request will be handled successfully. You can check the Logs for the result" - https://docs.opsgenie.com/docs/response#response-codes

The Logs tab can be found under the Settings tab. You could then search for the alert's message, alias, request ID, etc. to check if the request is received by Opsgenie:

 

comm 202 3.png

 

There is a chance the alert is getting deduplicated as well - meaning the request is increasing the count of an already existing open Opsgenie alert (if the alias is matching): https://docs.opsgenie.com/docs/alert-deduplication

You could also use the alert dash to check if this alert does exist / is being deduplicate by creating a query for the message, alias, etc. https://docs.opsgenie.com/docs/alerts-search-query-help

 

comm 202 4.png

Try these steps and let us know if you are able to find the alert, or run into any other questions or issues.

-Nick

Suggest an answer

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

Atlassian Community Events