Enrollmenttokens: create

Creates an enrollment token for the enterprise. This method is part of the EnrollmentTokensService.

Request

HTTP request

POST https://www.googleapis.com/androidenterprise/v1/enterprises/enterpriseId/enrollmentTokens

Parameters

Parameter name Value Description
Path parameters
enterpriseId string The ID of the enterprise.

Authorization

This request requires authorization with the following scope:

Scope
https://www.googleapis.com/auth/androidenterprise

For more information, see the authentication and authorization page.

Request body

In the request body, supply data with the following structure:

{
  "kind": "androidenterprise#enrollmentToken",
  "token": string,
  "enrollmentTokenType": string,
  "duration": {
    "seconds": long,
    "nanos": integer
  },
  "googleAuthenticationOptions": {
    "authenticationRequirement": string,
    "requiredAccountEmail": string
  }
}
Property name Value Description Notes
kind string
token string The token value that's passed to the device and authorizes the device to enroll. This is a read-only field generated by the server.
enrollmentTokenType string [Required] The type of the enrollment token.

Acceptable values are:
  • "enrollmentTokenTypeUnspecified"
  • "userDevice"
  • "userlessDevice"
duration nested object [Optional] The length of time the enrollment token is valid, ranging from 1 minute to Durations.MAX_VALUE, approximately 10,000 years. If not specified, the default duration is 1 hour.
duration.seconds long Signed seconds of the span of time.
googleAuthenticationOptions nested object [Optional] Provides options related to Google authentication during the enrollment.
googleAuthenticationOptions.authenticationRequirement string [Optional] Specifies whether user should authenticate with Google during enrollment. If provided, overrides the GoogleAuthenticationSettings for the enterprise resource when devices are enrolled with this token.

Acceptable values are:
  • "authenticationRequirementUnspecified"
  • "optional"
  • "required"
googleAuthenticationOptions.requiredAccountEmail string [Optional] Specifies the managed Google Account that the user must use during enrollment. AuthenticationRequirement must be set to REQUIRED if this field is set.

Response

If successful, this method returns a response body with the following structure:

{
  "kind": "androidenterprise#enrollmentToken",
  "token": string,
  "enrollmentTokenType": string,
  "duration": {
    "seconds": long,
    "nanos": integer
  },
  "googleAuthenticationOptions": {
    "authenticationRequirement": string,
    "requiredAccountEmail": string
  }
}
Property name Value Description Notes
kind string
token string The token value that's passed to the device and authorizes the device to enroll. This is a read-only field generated by the server.
enrollmentTokenType string [Required] The type of the enrollment token.

Acceptable values are:
  • "enrollmentTokenTypeUnspecified"
  • "userDevice"
  • "userlessDevice"
duration nested object [Optional] The length of time the enrollment token is valid, ranging from 1 minute to Durations.MAX_VALUE, approximately 10,000 years. If not specified, the default duration is 1 hour.
duration.seconds long Signed seconds of the span of time.
googleAuthenticationOptions nested object [Optional] Provides options related to Google authentication during the enrollment.
googleAuthenticationOptions.authenticationRequirement string [Optional] Specifies whether user should authenticate with Google during enrollment. This setting, if specified, GoogleAuthenticationSettings specified for the enterprise resource is ignored for devices enrolled with this token.

Acceptable values are:
  • "authenticationRequirementUnspecified"
  • "optional"
  • "required"
googleAuthenticationOptions.requiredAccountEmail string [Optional] Specifies the managed Google Account that the user must use during enrollment.AuthenticationRequirement must be set toREQUIRED if this field is set.