Hi Shaheen,
i am using powershell to interact with SOI. when i use headers as you suggested i got below error.
Invoke-RestMethod : Not AcceptableNot Acceptable
At line:19 char:13
+ $getAlert = Invoke-RestMethod -Headers $head -Method GET 'https://cac ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
however when i don't use heders it is running perfectly fine.
i am using below script.
$head = @{"content-type" = "application/vnd.ca.soi.api.v2+xml";"Accept"="application/vnd.ca.soi.api.v2+xml" }
$getAlert = Invoke-RestMethod -Headers $head -Method GET 'https://servername:7403/rest/alert' -Credential $SNowCreds
------------------------------
Senior Analyst
HCL technologies
Noida,India
------------------------------
Original Message:
Sent: 05-14-2020 09:23 AM
From: Shaheen Ahmed
Subject: How to Get the Alert Definition (Version 2) using REST API
Hi Amit,
On the REST call header the "Content-Type" and "Accept" key should have value of "application/vnd.ca.soi.api.v2+xml" (see the screen shot below)
Thanks
Shaheen
Original Message:
Sent: 05-14-2020 03:56 AM
From: amit anand
Subject: How to Get the Alert Definition (Version 2) using REST API
HI Shaheen,
I am not able access the KB article as i am getting below error message while accessing it.
------------------------------
Senior Analyst
HCL technologies
Noida,India
Original Message:
Sent: 05-13-2020 01:16 PM
From: Shaheen Ahmed
Subject: How to Get the Alert Definition (Version 2) using REST API
Hi Amit,
Your update is not clear on what exactly you are getting in the REST response and what exactly you are expecting to see. I am guessing that you are not getting the userAttribute properties and their values. Here is an article to help you get the v2 definition
https://ca-broadcomcsm.wolkenservicedesk.com/wolken/esd/knowledgebase_search?articleId=142073
Thanks
Shaheen
Original Message:
Sent: 05-13-2020 12:21 PM
From: amit anand
Subject: How to Get the Alert Definition (Version 2) using REST API
hello,
we are facing issue while fetching alert from SOI using REST API. we are able to fetch v1 of alert definition but not v2. need your expertise in solving this.
------------------------------
Senior Analyst
HCL technologies
Noida,India
------------------------------