The ID of the devices need to be identified to be able to apply operations on specific devices. Follow the steps given below to retrieve the device ID:
Execute the following command to retrieve the ID of the devices registered under a specific user:
Localtabgroup Localtab title cURL Code Block curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer <OAUTH_2.0_ACCESS_TOKEN>" -k -v https://<EMM_HOST>:<EMM_HTTPS:PORT>/api/device-mgt/v1.0/devices?user=<USERNAME>
- For more information on how to generate the OAuth2 Access Token, see Generating the OAuth 2.0 Access Token.
- By default,
<EMM_HOST>
islocalhost.
However, if you are using a public IP, the respective IP address or domain needs to be specified. - By default,
<EMM_HTTPS_PORT>
has been set to 9443. However, if the port offset has been incremented byn
, the default port value needs to be incremented byn
. - Provide the
<USERNAME>
of the user you wish to get the details of the registered device/s.
Example:
Code Block curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer e8975ad01fc5635dd7cabedefe00a9d7" -k -v https://localhost:9443/api/device-mgt/v1.0/devices?user=admin
Localtab title Sample output The sample output of the given example:
Code Block { "devices":[ { "id": 1,1, "name":"androiddevice1", "type":"android", "windows", "description":"this is an android device", "deviceIdentifier": "urn:uuid:TGSFB4g2-1456-7256-N826-163AFC462836","d24f870f390352a41", "enrolmentInfo": {{ "id": 1,3, "dateOfEnrolment": 1447936036918,1483609057777, "dateOfLastUpdate": 1447942337093,1483609057777, "ownership": "BYOD", "status": "ACTIVE", "owner": "admintest1" }, "properties":[ [ { "name": "IMEI", "value": "355768067631021" }, }, { "name": "IMSI", "value": "" }, }, { "name": "DEVICE_MODEL", "value": "Lumia 630" }, }, { "name": "OS_VERSION" }, { "name": "VENDOR",OS_BUILD_DATE" "value": "NOKIA" }, }, { "name": "LATITUDEVENDOR" }, }, { "name": "LONGITUDE" { }, { "name": "SERIAL" }, { "name": "DEVICEGCM_INFOTOKEN", "value": "480x800" }, }, { "name": "CHANNELDEVICE_URINAME" }, { "name": "DEVICE_NAMEINFO" }, } { "name": "MAC_ADDRESS",], "valueapplications": "D0-92-9E-8A-6E-28"[ } ] ] }, { "id": 3,2, "name": "titan_umtsandroiddevice10001", "type": "android", "description":"this is an android device"titan_umts",, "deviceIdentifier": "156928253613935d24f870f390352a410001", "enrolmentInfo": {{ "id": 3,4, "dateOfEnrolment": 1448292387532,1483609080149, "dateOfLastUpdate": 1448293906995,1483609081177, "ownership": "COPEBYOD", "status": "ACTIVE", "owner": "admintest1" }, "properties":[ [ { "name": "IMEI", "value": "359298055243973" }, }, { "name": "IMSI", "value": "413025702363929" }, }, { "name": "DEVICE_MODEL", "value": "XT1064" }, }, { "name": "OS_VERSION", "value": "5.0.2" }, }, { "name": "VENDOR",OS_BUILD_DATE" "value": "motorola" }, }, { "name": "LATITUDEVENDOR" }, { "name": "LONGITUDE"SERIAL" }, { "name": "SERIAL"GCM_TOKEN" }, { "name": "DEVICE_INFONAME", "value": "[{\"name\":\"IMEI\",\"value\":\"359298055243973\"},{\"name\":\"IMSI\",\"value\":\"413025702363929\"},{\"name\":\"DEVICE_MODEL\",\"value\":\"XT1064\"},{\"name\":\"VENDOR\",\"value\":\"motorola\"},{\"name\":\"OS_VERSION\",\"value\":\"5.0.2\"},{\"name\":\"DEVICE_NAME\",\"value\":\"titan_umts\"},{\"name\":\"BATTERY_LEVEL\",\"value\":\"70\"},{\"name\":\"INTERNAL_TOTAL_MEMORY\",\"value\":\"5.51\"},{\"name\":\"INTERNAL_AVAILABLE_MEMORY\",\"value\":\"0.47\"},{\"name\":\"EXTERNAL_TOTAL_MEMORY\",\"value\":\"5.51\"},{\"name\":\"EXTERNAL_AVAILABLE_MEMORY\",\"value\":\"0.47\"},{\"name\":\"OPERATOR\",\"value\":\"Dialog\"}]" }, { "name": "DEVICE}, { "name":"DEVICE_INFO" } ], "applications":[ { "id":1, "platform":"android", "category":"Business", "name":"Graphical", "locationUrl":"string", "imageUrl":"string", "version":"1.0.0", "type":"string", "appProperties":{ }, "applicationIdentifier":"string", "memoryUsage":0, "isActive":false } ] } ], "count":2 }
The ID of the devices registered under a specific user can be identified by searching for the property
deviceIdentifier
, in the output you receive when you run the command given under step 1.
Example: The device ID of the devices registered under admin.the user test1 is as follows:Code Block "deviceIdentifier": "urn:uuid:TGSFB4g2-1456-7256-N826-163AFC462836""d24f870f390352a41", "deviceIdentifier": "156928253613935d24f870f390352a410001",