Missed Team ’24? Catch up on announcements here.

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

hat is the Proper GenieKey Format for a Post API Integration?

J Paul
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!
January 30, 2024

I am attempting to build a Microsoft Power Automate flow that includes and HTTP action step that will send an alert to Opsgenie. I am following this documentation:
https://docs.opsgenie.com/docs/alert-api. Based upon this documentation,  the headers should be as follows:
curl -X POST https://api.opsgenie.com/v2/alerts -H "Content-Type: application/json" -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"

This is my set up in Power Automate

When I test this flow, I receive this response:

{
  "message""Key format is not valid!",
  "took"0,
  "requestId""b4ac57cd-5a0c-47ff-a426-0407c52dc9a5"
}
When I compare the GenieKeys from the documentation and the key in my integration I see the only difference is the 4th set of digits.
Doc example Key: eb243592-faa2-4ba2-a551q-1afdf565c889
My API Key:          5d1cb85a-1f5c-4bec-9ae5-8a7f96e5b9c0
I wouldn't t think that would make a difference, but maybe it does.
Also, I've tested using both of these URIs:
https://api.opsgenie.com/v2/alerts
https://api.eu.opsgenie.com/v2/alerts
just to eliminate that as a possibility. I'm in the U.S., so I believe I should use the https://api.opsgenie.com/v2/alerts.
I receive the same error for each test.

1 answer

1 accepted

0 votes
Answer accepted
Talar Pavlovic
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 31, 2024

Hi there J,

Thanks for writing into Community, I'm Talar from the Atlassian Opsgenie support team, happy to help! 

Opsgenie offers 2 types of API Keys -

  1. You can create one from Settings > API Key Management 
  2. You can create an API Integration (Settings > Integrations or Teams > Integrations)  

You can read more about the keys here: https://support.atlassian.com/opsgenie/docs/api-key-management/ 

I suspect that they API Key you're using there is from the Settings > API Key Management 

Could you please create an API Integration and use the key from there instead, please? 

If it still doesn't work, testing with another API tool (e.g. Postman) to double-check the endpoint and authorisation being used is valid might be useful! 

Hope this helps! 
Talar

 

PS. I'd recommend deleting the API key posted here as this is a public forum 🙂

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events