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=admintest1
Localtab title Sample output The sample output of the given example:
Code Block { "devices":[ { "id":1, "name":"androiddevice1", "type":"android", "description":"this is an android device", "deviceIdentifier":"d24f870f390352a41", "enrolmentInfo":{ "id":3, "dateOfEnrolment":1483609057777, "dateOfLastUpdate":1483609057777, "ownership":"BYOD", "status":"ACTIVE", "owner":"test1" }, "properties":[ { "name":"IMEI" }, { "name":"IMSI" }, { "name":"DEVICE_MODEL" }, { "name":"OS_VERSION" }, { "name":"OS_BUILD_DATE" }, { "name":"VENDOR" }, { "name":"SERIAL" }, { "name":"GCM_TOKEN" }, { "name":"DEVICE_NAME" }, { "name":"DEVICE_INFO" } ], "applications":[ ] }, { "id":2, "name":"androiddevice10001", "type":"android", "description":"this is an android device", "deviceIdentifier":"d24f870f390352a410001", "enrolmentInfo":{ "id":4, "dateOfEnrolment":1483609080149, "dateOfLastUpdate":1483609081177, "ownership":"BYOD", "status":"ACTIVE", "owner":"test1" }, "properties":[ { "name":"IMEI" }, { "name":"IMSI" }, { "name":"DEVICE_MODEL" }, { "name":"OS_VERSION" }, { "name":"OS_BUILD_DATE" }, { "name":"VENDOR" }, { "name":"SERIAL" }, { "name":"GCM_TOKEN" }, { "name":"DEVICE_NAME" }, { "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 the user test1 is as follows:Code Block "deviceIdentifier":"d24f870f390352a41", "deviceIdentifier":"d24f870f390352a410001",