jhakaas1708
jhakaas1708

Reputation: 33

How to get DeviceId for new provisioned Android devices inside EMM through Android Management APIs?

Writing a POC at the moment and don't want to depend on Google Cloud's Pub/Sub service for getting back the deviceId for a newly provisioned BYOD using Android Management APIs.

Is any any other way that after using an enrollment token for provisioning a device, that we can determine its deviceId?

Upvotes: 1

Views: 945

Answers (2)

Deyzel
Deyzel

Reputation: 196

Use enterprises.device.list to list all devices for a given enterprise. However, if multiple devices are provisioned between the device list calls, it will be more difficult to align the device id to a specific device.

Upvotes: 0

Sudhu
Sudhu

Reputation: 577

While creating the enrollment token (QR Code) you can pass additional data in it such as a unique policyId or a unique enrollment key

EnrollmentToken enrollmentTokenBody = new EnrollmentToken
{
    PolicyName = policyId,
    AdditionalData = enrollmentKey
}

Once the device is successfully enrolled, you can call the List Devices API - enterprises.devices.list which will return all the devices enrolled to the enterprise.

You can now find the device you just enrolled with the unique policy Id or enrollment key that you passed during the QR code generation.

This is a lengthy process and would not recommend it, I'd suggest you to use Pub/Sub instead.

Upvotes: 0

Related Questions