Get Users' Associated Devices
Problem
Your application needs to retrieve a list of all end users and their associated devices
Solution
Cisco UC Manager Version: 8.5
Use the executeSQLQuery AXL API to retrieve the UserIDs and associated Device Names. In this example we will use a SQL statement to get the data from the device, enduser, and enduserdevicemap tables.
Step 1: Retrieve UserIDs and Device Names
In this example, we will use the executeSQLQuery API to retrieve information about the phone. We are going to pass in the device name of the phone.
executeSQLQuery
Request Response
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/8.5"> <soapenv:Header/> <soapenv:Body> <ns:executeSQLQuery sequence="?"> <sql>select device.name, enduser.userid from device, enduser, enduserdevicemap where device.pkid=enduserdevicemap.fkdevice and enduser.pkid=enduserdevicemap.fkenduser </sql> </ns:executeSQLQuery> </soapenv:Body> </soapenv:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <ns:executeSQLQueryResponse xmlns:ns="http://www.cisco.com/AXL/API/8.5"> <return> <row> <name>ECPtest</name> <userid>test_enduser</userid> </row> <row> <name>SEP0024D7C4D69C</name> <userid>adrienne</userid> </row> </return> </ns:executeSQLQueryResponse> </soapenv:Body> </soapenv:Envelope>