為企業建立註冊權杖。 這個方法是 EnrollmentTokensService 的一部分。
要求
HTTP 要求
POST https://www.googleapis.com/androidenterprise/v1/enterprises/enterpriseId/enrollmentTokens
參數
| 參數名稱 | 值 | 說明 |
|---|---|---|
| 路徑參數 | ||
enterpriseId |
string |
企業的 ID。 |
授權
這項要求需要下列範圍的授權:
| 範圍 |
|---|
https://www.googleapis.com/auth/androidenterprise |
詳情請參閱驗證和授權頁面。
要求主體
在要求主體中,請按照下列結構提供資料:
{
"kind": "androidenterprise#enrollmentToken",
"token": string,
"enrollmentTokenType": string,
"duration": {
"seconds": long,
"nanos": integer
},
"googleAuthenticationOptions": {
"authenticationRequirement": string,
"requiredAccountEmail": string
}
}| 屬性名稱 | 值 | 說明 | 附註 |
|---|---|---|---|
kind |
string |
||
token |
string |
傳遞至裝置的權杖值,可授權裝置註冊。這是伺服器產生的唯讀欄位。 | |
enrollmentTokenType |
string |
[必要] 註冊權杖的類型。
可接受的值如下:
|
|
duration |
nested object |
[選用] 註冊權杖的有效時間長度,範圍從 1 分鐘到 Durations.MAX_VALUE,約為 10,000 年。如未指定,預設時間長度為 1 小時。 | |
duration.seconds |
long |
時間範圍的簽署秒數。 | |
googleAuthenticationOptions |
nested object |
[選用] 提供註冊期間與 Google 驗證相關的選項。 | |
googleAuthenticationOptions.authenticationRequirement |
string |
[選用] 指定使用者在註冊期間是否應透過 Google 驗證。如有提供,當裝置使用這個權杖註冊時,會覆寫企業資源的 GoogleAuthenticationSettings。
可接受的值如下:
|
|
googleAuthenticationOptions.requiredAccountEmail |
string |
[選用] 指定使用者在註冊時必須使用的受管理 Google 帳戶。如果設定這個欄位,AuthenticationRequirement 就必須設為 REQUIRED。 |
回應
如果成功的話,這個方法會傳回回應內文,其結構如下:
{
"kind": "androidenterprise#enrollmentToken",
"token": string,
"enrollmentTokenType": string,
"duration": {
"seconds": long,
"nanos": integer
},
"googleAuthenticationOptions": {
"authenticationRequirement": string,
"requiredAccountEmail": string
}
}| 屬性名稱 | 值 | 說明 | 附註 |
|---|---|---|---|
kind |
string |
||
token |
string |
傳遞至裝置的權杖值,可授權裝置註冊。這是伺服器產生的唯讀欄位。 | |
enrollmentTokenType |
string |
[必要] 註冊權杖的類型。
可接受的值如下:
|
|
duration |
nested object |
[選用] 註冊權杖的有效時間長度,範圍從 1 分鐘到 Durations.MAX_VALUE,約為 10,000 年。如未指定,預設時間長度為 1 小時。 | |
duration.seconds |
long |
時間範圍的簽署秒數。 | |
googleAuthenticationOptions |
nested object |
[選用] 提供註冊期間與 Google 驗證相關的選項。 | |
googleAuthenticationOptions.authenticationRequirement |
string |
[選用] 指定使用者在註冊期間是否應透過 Google 驗證。如果指定這項設定,系統會忽略為企業資源指定的 GoogleAuthenticationSettings,並套用至使用這組權杖註冊的裝置。
可接受的值如下:
|
|
googleAuthenticationOptions.requiredAccountEmail |
string |
[選用] 指定使用者註冊時必須使用的受管理 Google 帳戶。AuthenticationRequirement必須設為REQUIRED |