cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
200
Views
0
Helpful
6
Replies

ServiceNow CUCM Integration - Need API endpoint for all records

prakashJangam
Level 1
Level 1

I'm successfully able to retrieve information of one device from ServiceNow using SOAP,

Any idea on what SOAP method & body should I use to retrieve the information of all the devices hosted on the node using RISService70 ?

One Device:

Soap Method -   selectCmDeviceExt

 

6 Replies 6

prakashJangam
Level 1
Level 1

Sample Body - <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.cisco.com/ast/soap">
<soapenv:Header/>
<soapenv:Body>
<soap:selectCmDeviceExt>
<soap:StateInfo></soap:StateInfo>
<soap:CmSelectionCriteria>
<soap:MaxReturnedDevices>2000</soap:MaxReturnedDevices>
<soap:DeviceClass>Any</soap:DeviceClass>
<soap:Model>255</soap:Model>
<soap:Status>Any</soap:Status>
<soap:NodeName></soap:NodeName>
<soap:SelectBy>Name</soap:SelectBy>
<soap:SelectItems>
<!--Zero or more repetitions:-->
<soap:item>
<soap:Item>*******</soap:Item>
</soap:item>
</soap:SelectItems>
<soap:Protocol>Any</soap:Protocol>
<soap:DownloadStatus>Any</soap:DownloadStatus>
</soap:CmSelectionCriteria>
</soap:selectCmDeviceExt>
</soapenv:Body>
</soapenv:Envelope>

Randy Rozo
Level 1
Level 1

@prakashJangam 
To retrieve information about all devices hosted on the node using RISService70 and the selectCmDeviceExt method, you need to modify your SOAP request to include wildcard patterns or a broader scope in the query criteria. Here's how you can structure your SOAP body for this purpose:

SOAP Method: selectCmDeviceExt
SOAP Body Example:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns="http://schemas.cisco.com/ast/soap">
<soapenv:Header/>
<soapenv:Body>
<ns:selectCmDeviceExt>
<StateInfo></StateInfo>
<CmSelectionCriteria>
<MaxReturnedDevices>1000</MaxReturnedDevices>
<DeviceClass>Any</DeviceClass>
<Model>255</Model> <!-- 255 for all models -->
<Status>Any</Status>
<NodeName>ALL</NodeName> <!-- Use ALL to query all nodes -->
<SelectBy>IPV4ADDRESS</SelectBy>
<SelectItems>
<item>
<Item>*</Item> <!-- Wildcard to retrieve all devices -->
</item>
</SelectItems>
<Protocol>Any</Protocol>
</CmSelectionCriteria>
<ReturnedTags>
<Name></Name>
<Description></Description>
<Product></Product>
<Model></Model>
<Class></Class>
<NodeName></NodeName>
<IPAddress></IPAddress>
<MACAddress></MACAddress>
<Status></Status>
<Protocol></Protocol>
<ActiveLoadID></ActiveLoadID>
<InactiveLoadID></InactiveLoadID>
</ReturnedTags>
</ns:selectCmDeviceExt>
</soapenv:Body>
</soapenv:Envelope>


Please mark this as helpful or solution accepted to help others

Hi
Ty for the response but I'm getting error as 500 , any Idea ?

Request Body:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.cisco.com/ast/soap">
<soapenv:Header/>
<soapenv:Body>
<soap:selectCmDeviceExt>
<soap:StateInfo></soap:StateInfo>
<soap:CmSelectionCriteria>
<soap:MaxReturnedDevices>2000</soap:MaxReturnedDevices>
<soap:DeviceClass>Any</soap:DeviceClass>
<soap:Model>255</soap:Model>
<soap:Status>Any</soap:Status>
<soap:NodeName>ALL</soap:NodeName>
<soap:SelectBy>IPV4ADDRESS</soap:SelectBy>
<soap:SelectItems>
<!--Zero or more repetitions:-->
<soap:item>
<soap:Item>*</soap:Item>
</soap:item>
</soap:SelectItems>
<soap:Protocol>Any</soap:Protocol>
<soap:DownloadStatus>Any</soap:DownloadStatus>
</soap:CmSelectionCriteria>
</soap:selectCmDeviceExt>
</soapenv:Body>
</soapenv:Envelope>
HTTP Status: 500
Response Body :
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Server</faultcode><faultstring>unknown</faultstring><detail /></soapenv:Fault></soapenv:Body></soapenv:Envelope>

@prakashJangam 
Try the following:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.cisco.com/ast/soap">
<soapenv:Header/>
<soapenv:Body>
<soap:selectCmDeviceExt>
<soap:StateInfo></soap:StateInfo>
<soap:CmSelectionCriteria>
<soap:MaxReturnedDevices>2000</soap:MaxReturnedDevices>
<soap:DeviceClass>Any</soap:DeviceClass>
<soap:Model>255</soap:Model>
<soap:Status>Any</soap:Status>
<soap:NodeName>NombreDelNodo</soap:NodeName>
<soap:SelectBy>IPV4ADDRESS</soap:SelectBy>
<soap:SelectItems>
<!-- Deja este campo vacío para seleccionar todos los dispositivos -->
</soap:SelectItems>
<soap:Protocol>Any</soap:Protocol>
<soap:DownloadStatus>Any</soap:DownloadStatus>
</soap:CmSelectionCriteria>
</soap:selectCmDeviceExt>
</soapenv:Body>
</soapenv:Envelope>

  • MaxReturnedDevices: Specifies the maximum number of devices to return. The maximum allowed value is 2000.
  • DeviceClass: Specifies the device class. Possible values: Any, Phone, Gateway, H323, Cti, VoiceMail, MediaResources, HuntList, SIPTrunk, Unknown.
  • Model: The device model number. Use 255 to represent "any model."
  • Status: Filter devices by their status. Possible values: Any, Registered, UnRegistered, Rejected, PartiallyRegistered, Unknown.
  • NodeName: The name of the Cisco Unified Communications Manager node to query. Leave this blank to query all nodes in the cluster.
  • SelectBy: The criteria for selecting devices. Possible values: Name, IPV4Address, IPV6Address, DirNumber, Description, SIPStatus.
  • SelectItems: A list of items to match against the SelectBy criteria. For example, if SelectBy is Name, include device names here. To select all devices, leave this empty or use a wildcard (*).
  • Protocol: The device protocol. Possible values: Any, SCCP, SIP, Unknown.
  • DownloadStatus: The download status of the device. Possible values: Any, Upgrading, Successful, Failed, Unknown.

If you encounter a 500 error, ensure that all parameters are correctly configured and that the rate limits are not exceeded.


Please mark this as helpful or solution accepted to help others

HI Randy 
Tried the above but no luck 
Documentation says leave blank for all devices but error says otherwise , Any thoughts?

Error :

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Server</faultcode><faultstring>ERROR: SelectItems cannot be null</faultstring><detail /></soapenv:Fault></soapenv:Body></soapenv:Envelope>

@prakashJangam 

Try the following:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.cisco.com/ast/soap">
<soapenv:Header/>
<soapenv:Body>
<soap:selectCmDeviceExt>
<soap:StateInfo></soap:StateInfo>
<soap:CmSelectionCriteria>
<soap:MaxReturnedDevices>2000</soap:MaxReturnedDevices>
<soap:DeviceClass>Any</soap:DeviceClass>
<soap:Model>255</soap:Model>
<soap:Status>Any</soap:Status>
<soap:NodeName>ALL</soap:NodeName>
<soap:SelectBy>Name</soap:SelectBy>
<soap:SelectItems>
<soap:item>
<soap:Item>*</soap:Item>
</soap:item>
</soap:SelectItems>
<soap:Protocol>Any</soap:Protocol>
<soap:DownloadStatus>Any</soap:DownloadStatus>
</soap:CmSelectionCriteria>
</soap:selectCmDeviceExt>
</soapenv:Body>
</soapenv:Envelope>

SelectBy:

  • You are using IPV4ADDRESS, but the wildcard * in SelectItems might not work with this SelectBy value. Try changing SelectBy to Name if * should represent "all devices."

    Some configurations or versions of the API might not support * in SelectItems, even if documentation implies it should work.