Enroll a Device and Confirm It Checked In
A 5-step recipe with Google Android. We can help you get access.
Recipe · 5 steps
Enroll a Device and Confirm It Checked In
with Google Android
Issue an enrollment token for a known policy and verify the device enrolls against it.
- Read the policy the device will enroll onto. Enrolling against a policy name that does not exist yields a device stuck without configuration, so this is checked before a token is minted.
- List the enrollment tokens already outstanding for this enterprise so an operator can see whether a valid token exists before minting another.
- Mint a short-lived enrollment token bound to the confirmed policy. The qrCode value is what the factory-reset device scans.
- Poll the enterprise device list until the newly provisioned device checks in. Enrollment is asynchronous from the API's point of view, so this step is retried until a device is present.
- Read the enrolled device and confirm it applied the policy the token was bound to, rather than merely appearing in the fleet.
What you'll need to have ready
- enterpriseName: The enterprise resource name (e.g. enterprises/LC0123abcd).
- policyName: The full policy resource name the device should enroll onto.
- tokenDuration: How long the enrollment token stays valid, as a duration (e.g. 3600s).
- username: Optional account identifier to associate with the enrolled device.
For your developer
Arazzo workflow google-android:enroll-device, 5 operations: getPolicy → listEnrollmentTokens → createEnrollmentToken → listDevices → getDevice. Specs on APIs.io.