"Hello World" Login

The UserQuery operation returns the user ID that is logged in to the specified device

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>
<deviceuserquery>
<devicename>SEP003094C25B15</devicename>
</deviceuserquery>
</query>

Encoded

1
2
3
4
5
6
7
8
9
xml=%3Cquery%3E
%3CappInfo%3E
%3CappID%3Eappid%3C/appID%3E
%3CappCertificate%3Eapppasswd%3C/appCertificate%3E
%3C/appInfo%3E
%3CdeviceUserQuery%3E
%3CdeviceName%3ESEP003094C25B15%3C/deviceName%3E
%3C/deviceUserQuery%3E
%3C/query%3E

Success Response

If you log in to the phone for the first time, the response is as follows:

1
2
3
4
5
6
7
8
<response>
<deviceuserresults>
<devicename="SEP003094C25B15">
<userid>john</userid>
<none/>
</device>
</deviceuserresults>
</response>

If you have previously logged in to the phone, the response is as follows:

1
2
3
4
5
6
7
8
<response>
<deviceuserresults>
<devicename="SEP003094C25B15">
<userid>john</userid>
<lastlogin>john</lastlogin>
</device>
</deviceuserresults>
</response>

DeviceQuery Request

View a sample DeviceQuery request