Hi, all.
I'm trying to create an alert via OpsGenie API but I'm getting an error related to the authentication.
Please, find below the steps I'm following and all the details about the problem.
Here is the command I'm executing:
curl --location --request POST 'https://api.opsgenie.com/v2/alerts' \--header 'Authorization: GenieKey <MY API KEY>' \--header 'Content-Type: text/plain' \--data-raw ''\''{"message": "Test alert", "description": "This is just a test" }'\''' But, I'm getting this error:
{ "code": 40301, "message": "To perform this action, use an API key from an API integration.", "took": 0.002, "requestId": "1343b720-98e8-49f1-bb4e-1706c2b9ae83"}
I generated the API key from the settings menu (Settings -> API Key Management). The API key has read, create and update access rights.
Regarding the API URL, I tried to use the Europe URL - https://api.eu.opsgenie.com/v2/alerts
But, I get this error
{ "message": "Could not authenticate", "took": 0.007, "requestId": "6d3adc4c-d201-4fdc-9caf-8db62233e4fb"}
What am I missing?
Thanks in advance.