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"
}'
I'm using the documentation as a reference:
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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"
}'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bruno,
Thank you for sharing that.
Testing in Postman with the same body shared above, I created an alert as expected with the details (extra properties) added as expected:
One thing I would suggest also reviewing is the create alert action being used for this alert in the API integration. Maybe the action is wiping the extra properties at creation, and should at the very least have this configured to dynamically parse those fields / values:
Otherwise Opsgenie support should be able to assist further.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.