Getting Device Details of a User
Description | If you wish to get the details of the devices enrolled by a specific user, you can do so using the REST API given below. | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Resource Path | /devices | ||||||||||||||||||||||||||||
URL | /mdm-admin/users/devices?username={username}
| ||||||||||||||||||||||||||||
HTTP Method | GET | ||||||||||||||||||||||||||||
Request/Response Format | application/json | ||||||||||||||||||||||||||||
cURL command | curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer <EMM_API_TOKEN>" -k -v https://<EMM_HOST>:<EMM_HTTPS_PORT>/mdm-admin/users/view?username={username}
Example: curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a" -k -v https://localhost:9443/mdm-admin/users/view?username=kim You can filter the device details further, using the query parameters given below:
Example: curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a" -k -v https://localhost:9443/mdm-admin/users/view?username=kim&start=1&length=3 | ||||||||||||||||||||||||||||
 Sample output | > GET /mdm-admin/users/devices?username=kim HTTP/1.1 > Host: localhost:9443 > User-Agent: curl/7.43.0 > Accept: */* > Content-Type: application/json > Authorization: Bearer 6171fbf32fd653c29f14f0acef1900ca > < HTTP/1.1 200 OK < Cache-Control: private < Expires: Thu, 01 Jan 1970 05:30:00 IST < Date: Sat, 05 Mar 2016 07:04:46 GMT < Content-Type: application/json < Content-Length: 1196 < Server: WSO2 Carbon Server [{"id":1,"name":"titan_umts","type":"android","description":"titan_umts","deviceIdentifier":"359298055243973","enrolmentInfo":{"id":1,"dateOfEnrolment":1457160869352,"dateOfLastUpdate":1457160869352,"ownership":"BYOD","status":"ACTIVE","owner":"admin"},"properties":[{"name":"IMEI","value":"359298055243973"},{"name":"IMSI","value":"413025702363929"},{"name":"DEVICE_MODEL","value":"XT1064"},{"name":"OS_VERSION","value":"6.0"},{"name":"VENDOR","value":"motorola"},{"name":"SERIAL"},{"name":"DEVICE_INFO","value":"[{\"name\":\"IMEI\",\"value\":\"359298055243973\"},{\"name\":\"IMSI\",\"value\":\"413025702363929\"},{\"name\":\"DEVICE_MODEL\",\"value\":\"XT1064\"},{\"name\":\"VENDOR\",\"value\":\"motorola\"},{\"name\":\"OS_VERSION\",\"value\":\"6.0\"},{\"name\":\"DEVICE_NAME\",\"value\":\"titan_umts\"},{\"name\":\"BATTERY_LEVEL\",\"value\":\"88\"},{\"name\":\"INTERNAL_TOTAL_MEMORY\",\"value\":\"5.51\"},{\"name\":\"INTERNAL_AVAILABLE_MEMORY\",\"value\":\"0.43\"},{\"name\":\"EXTERNAL_TOTAL_MEMORY\",\"value\":\"0.0\"},{\"name\":\"EXTERNAL_AVAILABLE_MEMORY\",\"value\":\"0.0\"},{\"name\":\"OPERATOR\",\"value\":\"Dialog\"}]"},{"name":"DEVICE_NAME","value":"titan_umts"},{"name":"GCM_TOKEN"}]}] | ||||||||||||||||||||||||||||
Sample JSON Output Definition | [ { "id": 1, "name": "titan_umts", "type": "android", "description": "titan_umts", "deviceIdentifier": "359298055243973", "enrolmentInfo": { "id": 1, "dateOfEnrolment": 1457160869352, "dateOfLastUpdate": 1457160869352, "ownership": "BYOD", "status": "ACTIVE", "owner": "admin" }, "properties": [ { "name": "IMEI", "value": "359298055243973" }, { "name": "IMSI", "value": "413025702363929" }, { "name": "DEVICE_MODEL", "value": "XT1064" }, { "name": "OS_VERSION", "value": "6.0" }, { "name": "VENDOR", "value": "motorola" }, { "name": "SERIAL" }, { "name": "DEVICE_INFO", "value": "[{\"name\":\"IMEI\",\"value\":\"359298055243973\"},{\"name\":\"IMSI\",\"value\":\"413025702363929\"},{\"name\":\"DEVICE_MODEL\",\"value\":\"XT1064\"},{\"name\":\"VENDOR\",\"value\":\"motorola\"},{\"name\":\"OS_VERSION\",\"value\":\"6.0\"},{\"name\":\"DEVICE_NAME\",\"value\":\"titan_umts\"},{\"name\":\"BATTERY_LEVEL\",\"value\":\"88\"},{\"name\":\"INTERNAL_TOTAL_MEMORY\",\"value\":\"5.51\"},{\"name\":\"INTERNAL_AVAILABLE_MEMORY\",\"value\":\"0.43\"},{\"name\":\"EXTERNAL_TOTAL_MEMORY\",\"value\":\"0.0\"},{\"name\":\"EXTERNAL_AVAILABLE_MEMORY\",\"value\":\"0.0\"},{\"name\":\"OPERATOR\",\"value\":\"Dialog\"}]" }, { "name": "DEVICE_NAME", "value": "titan_umts" }, { "name": "GCM_TOKEN" } ] } ]
|