"Hello World" DeviceQuery

The DeviceQuery operation returns all device IDs (MAC addresses) for the specified user ID.

The following example finds the devices that user ID "john" is logged in to.

When creating the request body, it is recommended to first build in XML format and then encode the XML before sending to the CUCM server. The first part of the example shows the XML unencoded and the second part of the example shows the XML encoded.

Request


POST /emservice/EMServiceServlet
Content-Type: application/x-www-form-urlencoded

Unencoded

?
1
2
3
4
5
6
7
8
9
<query>
<appinfo>
<appid>appid</appid>
<appcertificate>apppasswd</appcertificate>
</appinfo>
<userdevicesquery>
<userid>john</userid>
</userdevicesquery>
</query>

Encoded

?
1
2
3
4
5
6
7
8
9
xml=%3Crequest%3E
%3CappInfo%3E
%3CappID%3Eappid%3C/appID%3E
%3CappCertificate%3Eapppasswd%3C/appCertificate%3E
%3C/appInfo%3E
%3CuserDevicesQuery%3E
%3CuserID%3Ejohn%3C/userID%3E
%3C/userDevicesQuery%3E
%3C/query%3E

Success Response

1
2
3
4
5
6
7
8
<response>
<userdevicesresults>
<user id="john">
<devicename>SEP003094C25B15</devicename>
<devicename>SEP003094C25B49</devicename>
</user>
</userdevicesresults>
</response>

DeviceProfileQuery Request

View a sample DeviceProfileQuery request