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.