I'm trying to create an alert in Opsgenie. I created an api integration and I'm using the Geniekey from that integration.
I'm actually using postman but postman very helpfully outputs a cURL format and that's easier to paste in here:
curl --location --request POST 'https://api.opsgenie.com/v2/alerts' \
--header 'Content-Type: application/json' \
--header 'Authorization: GenieKey <api integration>' \
--header 'Host: api.opsgenie.com' \
--data-raw '{"message": "test message"}'
Result: 500 bad request
{
"message": "Body should be a JSON object",
"took": 0.0,
"requestId": "<hash>"
}
Presumably this means that the body of the message isn't JSON but it certainly is. According to the documentation (https://docs.opsgenie.com/docs/alert-api) the only required field is message so that's all I added.
In my experience the problem will be trivial and obvious but I just can't see it in this case.
Please help me out and tell me what's wrong here!
Thanks
Dave