This is my request:
curl --location 'myUrl' \--header 'X-OpsGenie-Key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \--header 'Content-Type: application/json' \--header 'Cookie: __cf_bm=ckl61dMKQWxlJnqbN241pQyu9qXIkROu.21cQCTCVa0-1709231789-1.0-AYSDGyb3aGOTAsSRTDa9XleOUXhK7YYys+QjJxzM+w1EK7QtgNAgwoBJx0aH7wEvDjHW/434zuKihOuD3HVAeCk=' \--data '{"description":"test description","details":{"key1":"value1","key2":"value2"},"source":"contrel","message":"test","priority":"P3","isExtraPropertiesWithKey": "true"}'
This is result:
what is wrong?
Hi @Bruno Willian Conke das Neves ,
The JSON body (which looks correct) you shared compared to the screenshot looks to be a for different alert?
I would check the Logs tab to see if the request was received by Opsgenie. If the request was received - but an alert was not created - then this Community post should help troubleshoot why that did not occur:
Integration not creating Opsgenie alert
If that JSON body is for the alert you shared, I would review the alert's Activity log tab to see if some sort of alert policy is applying to the alert and modifying the fields such as the details (aka extra properties).
Again, the body you shared looks correct.
Hi,
The json is the same structure as the alert, I just change some values.
I saw the logs and it looks like everything was created correctly.
Is there any chance of sharing the actual JSON and not just the structure?
If not - I would suggest reaching out to Opsgenie support so they can take a deeper look into your instance and review why the details are not being added through the alert API.
Here is the real json used
{"description":"Só sei que nada sei, por isso errei.","details":{"key1":"value1","key2":"value2"},"source":"contrel","message":"Teste Titulo do erro","priority":"P3","isExtraPropertiesWithKey": "true"}
and here is the complete Curl
curl --location 'myurl' \--header 'X-OpsGenie-Key: mykey' \--header 'Content-Type: application/json' \--data '{"description":"Só sei que nada sei, por isso errei.","details":{"key1":"value1","key2":"value2"},"source":"contrel","message":"Teste Titulo do erro","priority":"P3","isExtraPropertiesWithKey": "true"}'
It looks like you're new here. Sign in or register to get started.