重要提示:我们不再接受 Play EMM API 的新注册。
了解详情。
Enterprises: createWebToken
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
返回用于访问嵌入式界面的唯一令牌。要生成
网页界面,将生成的令牌传递到 Google Play 企业版 JavaScript
API。每个令牌只能用于启动一个界面会话。请参阅
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 |
用于显示“Play 企业版搜索应用”页面的选项。 |
|
playSearch.enabled |
boolean |
是否显示 Google Play 企业版搜索应用页面。默认值为 true。 |
|
playSearch.approveApps |
boolean |
允许在 批准模式下访问 iframe。默认值为 false。 |
|
privateApps |
nested object |
用于显示“专用应用”页面的选项。 |
|
privateApps.enabled |
boolean |
是否显示“专用应用”页面。默认值为 true。 |
|
webApps |
nested object |
用于显示“Web 应用”页面的选项。 |
|
webApps.enabled |
boolean |
是否显示“Web 应用”页面。默认值为 true。 |
|
storeBuilder |
nested object |
用于显示“整理应用”页面的选项。 |
|
storeBuilder.enabled |
boolean |
是否显示“整理应用”页面。默认值为 true。 |
|
managedConfigurations |
nested object |
用于显示“托管配置”页面的选项。 |
|
managedConfigurations.enabled |
boolean |
是否显示“受管配置”页面。默认值为 true。 |
|
kind |
string |
|
|
zeroTouch |
nested object |
用于显示“零触摸”页面的选项。 |
|
zeroTouch.enabled |
boolean |
零触摸嵌入式界面是否可用于此令牌。启用后,管理员可以将零触摸客户与此企业相关联。 |
|
响应
如果成功,此方法将返回采用以下结构的响应正文:
{
"kind": "androidenterprise#administratorWebToken",
"token": string
}
属性名称 |
值 |
说明 |
备注 |
token |
string |
要传递给 Play 前端以生成 iframe 的不透明令牌。 |
|
kind |
string |
|
|
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-09-10。
[null,null,["最后更新时间 (UTC):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` | | |"]]