I am trying to get the "Extra properties" using the Alert API. How should I construct the params to get all "Extra properties" associated with alert?
I tried "isExtraPropertiesWithKey=true" but still it did not gave me the "Extra properties" in the Json response.
Hi @Nick H
I tried to pull the individual alert as you mentioned.
One of the alert I picked has the extra properties in the alert as shown below
After getting the response in Postman I searched for the `alerts@splunkcloud.com` in Json body but it did not show it.
Even there is no details json attribute in the body
Hi @Rakesh Panchal ,
I can't say for certain those aren't the same alerts, but the top screenshot in Opsgenie shows the alert being a P3, while your Postman screenshot shows the alert being P4 - which leads me to believe those are not the same.
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.
Not sure what parameter you are using in the URL, but can you try running a GET on the tiny ID of that alert to see if you have the same results? Your URL would be:
https://api.opsgenie.com/v2/alerts/87312?identifierType=tiny
This should return the extra properties in the details of the JSON body, and I'm assuming you might be querying on another alert still. For example:
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.
Hi @Rakesh Panchal ,
If you are running a GET on an individual alert, the extra properties should return in the JSON body without any sort of query needed under the details of the alert:
If you are trying to run a GET on alerts that contain extra properties, you would need to query on these using the details since this is where the extra properties parse.
Our documentation mentions using details, details.key and/or details.value - but you could also use something like this as well for null queries:
details.key is not null
After I know the query in the Opsgenie UI, I typically copy / paste it into a URL encoder to ensure I am using the correct parameters in 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.
Hi @Nick H
Thanks for your response.
I am not doing GET on individual Alert. I am getting data based on "updatedAt" between a certain time frame. and in this case I am not getting the details attribute in the Json response.
Here is the
Would you please able to guide me what else needs to be passed to get the details (extra properties)?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't believe it's possible to return the extra properties on a List Alert API. There's a sample response in the documentation and not shown in it is the extra properties (aka the details) of the alerts.
So you would need to run an individual GET on each alert to return the extra properties, or create some script that runs a GET on each alert once you have the query needed. Unfortunately I don't have a script to share.
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.