Hi,
So recently my requests sent to https://api.opsgenie.com/v2/alerts/requests/ are returning 404 errors.
If I don't include the authorization header I get could not authenticate, requests I send to https://api.opsgenie.com/v2/alerts/ work fine, and it worked okay last week.
No valid request id is working.
{
var uri = $"https://api.opsgenie.com/v2/alerts/requests/{requestId}";
client.Headers.Add(HttpRequestHeader.Authorization, genieKey);
request = client.DownloadString(uri);
}
I'm not sure what I'm doing wrong.
Thanks for reaching out!
So in relation to this REST call https://docs.opsgenie.com/docs/alert-api#get-request-status
The Get Request Status endpoint is used to track the status and alert details (if any) of the request whose identifier is given.
I would like to point out I am not a C# specialist but in best efforts provide some information that may help you with your troubleshooting here. What I can do is share an example for this request using C# - RestSharp
using RestSharp;
using RestSharp.Authenticators;
var client = new RestClient("https://api.opsgenie.com/v2/alerts/requests/913fb485-2a30-4b03-b9cb-6207599669d9");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Something I have noticed from your code is that your genieKey is not enclosed with "" like it is in my example code. You could try that and see if it works on your end!
Let me know how you go with this one or have any follow up questions.
Thanks,
Connor
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.