重要資訊:我們目前不接受新的 Play EMM API 註冊。
瞭解詳情。
Enterprises: createWebToken
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
傳回專屬權杖來存取嵌入式 UI。如要產生
並把產生的權杖傳遞至 Google Play 管理版 JavaScript
也能使用 Google Cloud CLI 或
Compute Engine API每個權杖只能用來啟動一個 UI 工作階段。詳情請參閱
如需其他資訊,請參閱 JavaScript API 說明文件。
要求
HTTP 要求
POST https://www.googleapis.com/androidenterprise/v1/enterprises/enterpriseId/createWebToken
參數
參數名稱 |
值 |
說明 |
路徑參數 |
enterpriseId |
string |
企業的 ID。
|
授權
此要求需要具有下列範圍的授權:
範圍 |
https://www.googleapis.com/auth/androidenterprise |
詳情請參閱「驗證與授權」網頁。
要求主體
在要求主體中,提供具有以下結構的資料:
{
"kind": "androidenterprise#administratorWebTokenSpec",
"permission": [
string
],
"parent": string,
"playSearch": {
"enabled": boolean,
"approveApps": boolean
},
"privateApps": {
"enabled": boolean
},
"webApps": {
"enabled": boolean
},
"storeBuilder": {
"enabled": boolean
},
"managedConfigurations": {
"enabled": boolean
},
"zeroTouch": {
"enabled": boolean
}
}
屬性名稱 |
值 |
說明 |
附註 |
permission[] |
list |
已淘汰,使用 PlaySearch.approveApps 。 |
|
parent |
string |
代管 iframe 的上層頁框 URI。為防止 XSS,iframe 不得代管於其他 URI。這個 URI 必須是 https。請使用空格來分隔多個父項 URI。 |
|
playSearch |
nested object |
顯示 Google Play 管理版應用程式頁面的選項。 |
|
playSearch.enabled |
boolean |
是否要顯示 Google Play 管理版應用程式頁面。預設值為 true。 |
|
playSearch.approveApps |
boolean |
在 核准模式中允許存取 iframe。預設值為 false。 |
|
privateApps |
nested object |
顯示「私人應用程式」頁面的選項。 |
|
privateApps.enabled |
boolean |
是否顯示「私人應用程式」頁面。預設值為 true。 |
|
webApps |
nested object |
顯示「網頁應用程式」頁面的選項。 |
|
webApps.enabled |
boolean |
是否顯示「Web Apps」頁面。預設值為 true。 |
|
storeBuilder |
nested object |
顯示「整理應用程式」頁面的選項。 |
|
storeBuilder.enabled |
boolean |
是否顯示「整理應用程式」頁面。預設值為 true。 |
|
managedConfigurations |
nested object |
顯示「受管理設定」頁面的選項。 |
|
managedConfigurations.enabled |
boolean |
是否會顯示「受管理設定」頁面。預設值為 true。 |
|
kind |
string |
|
|
zeroTouch |
nested object |
「零接觸」頁面的顯示選項。 |
|
zeroTouch.enabled |
boolean |
是否可透過這個權杖使用零接觸嵌入式 UI。如果啟用,管理員可以將零接觸客戶連結至這個企業。 |
|
回應
如果成功的話,這個方法會傳回回應內文,其結構如下:
{
"kind": "androidenterprise#administratorWebToken",
"token": string
}
屬性名稱 |
值 |
說明 |
附註 |
token |
string |
要傳遞至 Play 前端以產生 iframe 的不透明權杖。 |
|
kind |
string |
|
|
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-09-10 (世界標準時間)。
[null,null,["上次更新時間:2024-09-10 (世界標準時間)。"],[[["\u003cp\u003eGenerates a unique token for accessing an embeddable UI for managing Google Play apps in an enterprise.\u003c/p\u003e\n"],["\u003cp\u003eRequires authorization with the \u003ccode\u003ehttps://www.googleapis.com/auth/androidenterprise\u003c/code\u003e scope.\u003c/p\u003e\n"],["\u003cp\u003eThe request body allows customization of which pages are displayed in the UI, such as Play Search, Private Apps, and Web Apps.\u003c/p\u003e\n"],["\u003cp\u003eThe response includes an opaque token to be used with the managed Google Play javascript API to generate the UI iframe.\u003c/p\u003e\n"],["\u003cp\u003eThe token is single-use and intended for one UI session only.\u003c/p\u003e\n"]]],[],null,["# Enterprises: createWebToken\n\n| **Note:** Requires [authorization](#auth).\n\nReturns a unique token to access an embeddable UI. To generate a\nweb UI, pass the generated token into the managed Google Play javascript\nAPI. Each token may only be used to start one UI session. See the\n[JavaScript API documentation](https://developers.google.com/api-client-library/javascript/apis/androidenterprise/v1) for further information.\n\nRequest\n-------\n\n### HTTP request\n\n```\nPOST https://www.googleapis.com/androidenterprise/v1/enterprises/enterpriseId/createWebToken\n```\n\n### Parameters\n\n| Parameter name | Value | Description |\n|----------------|----------|---------------------------|\n| **Path parameters** |||\n| `enterpriseId` | `string` | The ID of the enterprise. |\n\n### Authorization\n\nThis request requires authorization with the following scope:\n\n| Scope |\n|-----------------------------------------------------|\n| `https://www.googleapis.com/auth/androidenterprise` |\n\nFor more information, see the [authentication and authorization](/android/work/play/emm-api/v1/how-tos/authorizing) page.\n\n### Request body\n\nIn the request body, supply data with the following structure:\n\n```text\n{\n \"kind\": \"androidenterprise#administratorWebTokenSpec\",\n \"permission\": [\n string\n ],\n \"parent\": string,\n \"playSearch\": {\n \"enabled\": boolean,\n \"approveApps\": boolean\n },\n \"privateApps\": {\n \"enabled\": boolean\n },\n \"webApps\": {\n \"enabled\": boolean\n },\n \"storeBuilder\": {\n \"enabled\": boolean\n },\n \"managedConfigurations\": {\n \"enabled\": boolean\n },\n \"zeroTouch\": {\n \"enabled\": boolean\n }\n}\n```\n\n| Property name | Value | Description | Notes |\n|---------------------------------|-----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------|\n| `permission[]` | `list` | Deprecated. Use `PlaySearch.approveApps`. | |\n| `parent` | `string` | The URI of the parent frame hosting the iframe. To prevent XSS, the iframe may not be hosted at other URIs. This URI must be https. Use whitespaces to separate multiple parent URIs. | |\n| `playSearch` | `nested object` | Options for displaying the managed Play Search apps page. | |\n| playSearch.`enabled` | `boolean` | Whether the managed Play Search apps page is displayed. Default is true. | |\n| playSearch.`approveApps` | `boolean` | Allow access to the iframe in [approve mode](https://developers.google.com/android/work/play/emm-api/managed-play-iframe#render). Default is false. | |\n| `privateApps` | `nested object` | Options for displaying the Private Apps page. | |\n| privateApps.`enabled` | `boolean` | Whether the Private Apps page is displayed. Default is true. | |\n| `webApps` | `nested object` | Options for displaying the Web Apps page. | |\n| webApps.`enabled` | `boolean` | Whether the Web Apps page is displayed. Default is true. | |\n| `storeBuilder` | `nested object` | Options for displaying the Organize apps page. | |\n| storeBuilder.`enabled` | `boolean` | Whether the Organize apps page is displayed. Default is true. | |\n| `managedConfigurations` | `nested object` | Options for displaying the Managed Configuration page. | |\n| managedConfigurations.`enabled` | `boolean` | Whether the Managed Configuration page is displayed. Default is true. | |\n| `kind` | `string` | | |\n| `zeroTouch` | `nested object` | Options for displaying the Zero Touch page. | |\n| zeroTouch.`enabled` | `boolean` | Whether zero-touch embedded UI is usable with this token. If enabled, the admin can link zero-touch customers to this enterprise. | |\n\nResponse\n--------\n\nIf successful, this method returns a response body with the following structure:\n\n```text\n{\n \"kind\": \"androidenterprise#administratorWebToken\",\n \"token\": string\n}\n```\n\n| Property name | Value | Description | Notes |\n|---------------|----------|---------------------------------------------------------------------------|-------|\n| `token` | `string` | An opaque token to be passed to the Play front-end to generate an iframe. | |\n| `kind` | `string` | | |"]]