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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,459,990
Community Members
 
Community Events
176
Community Groups

How can I get azure alertid by GET request response id?

Edited

Hi,

I create opsgene azure alerts by api requests like this.

https://api.opsgenie.com/v1/json/azure?apiKey=xxxxxxxApiKeyxxxxxxxxx

{
"schemaId": "azureMonitorCommonAlertSchema",
"data": {
"essentials": {
"alertRule": "StorageCheck high message ",
"severity": "Sev3",
"signalType": "Metric",
"monitorCondition": "Fired",
"monitoringService": "Platform",
"firedDateTime": "2020-06-29T18:41:05.7016722Z",
"description": "Test Description",
"essentialsVersion": "1.0",
"alertContextVersion": "1.0"
},
"alertContext": {
"properties": null,
"conditionType": "SingleResourceMultipleMetricCriteria",
"condition": {
"windowSize": "PT1M",
"allOf": [{
"metricName": "SuccessfulRequests",
"metricNamespace": "Microsoft.EventHub/namespaces",
"operator": "GreaterThan",
"threshold": "2",
"timeAggregation": "Total",
"dimensions": [{
"name": "EntityName",
"value": "test-eventhub"
}, {
"name": "OperationResult",
"value": "Success"
}],
"metricValue": 4.0,
"webTestName": null
}],
"windowStartTime": "2020-06-29T18:38:52.06Z",
"windowEndTime": "2020-06-29T18:39:52.06Z"
}
}
}
}

And i want to get alert id by get request.

I tried use this request:
https://api.opsgenie.com/v2/alerts/requests/xxxxxxxRequestsIDxxxxxxxxx

Authorization: GenieKey xxxxxxxApiKeyxxxxxxxxx

Content-Type: application/json

Body {} 

But its return me 403 error The request could not be satisfied.

If request without body its return me message "Request not found. It might not be processed, yet."


I tried another request:

https://api.opsgenie.com/v1/json/azure/alerts/requests/xxxxxxxRequestsIDxxxxxxxxx?apiKey=xxxxxxxApiKeyxxxxxxxxx

Content-Type: application/json

Body {}

But its return me 403 error The request could not be satisfied.

What the correct way to get azure alert id by request id?

2 answers

1 accepted

1 vote
Answer accepted
Nick H Atlassian Team Apr 06, 2022

Hi @Bohdan Kukliuk ,

Are you able to run a general List Alerts API call, then use this to GET that specific alert's ID?

If you do that, the request ID will also be returned in the GET on the specific alert.

https://docs.opsgenie.com/docs/alert-api#list-alerts

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

0 votes

Actually - my initial response is not correct. The request ID returned in the GET alert response is the request of that specific API call. 

Without capturing the create alert request ID when the request is completed, I don't believe there is a way to GET it with any of our API calls - besides checking the alert's activity log in Opsgenie, which should capture the request ID here:

reqid.jpg

 

But like mentioned in my past response, you should still be able to use the Alert API to list alerts, and use the alert's ID to run a GET to pull the alert as well.

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events