API Reference

此 API 参考资料按资源类型编排整理。每种资源类型都有一种或多种数据表示形式以及一个或多个方法。

资源类型

  1. 设备
  2. 企业
  3. 使用权
  4. 群组许可
  5. Grouplicenseusers
  6. 安装次数
  7. 设备的受管配置
  8. 面向用户的受管配置
  9. 受管配置设置
  10. 权限
  11. 产品
  12. 服务账号
  13. Storelayoutclusters
  14. Storelayoutpages
  15. 用户
  16. Web 应用

设备

如需详细了解设备资源,请参阅资源表示形式页面。

方法 HTTP 请求 说明
除非另有说明,否则将使用相对于 https://www.googleapis.com/androidenterprise/v1 的 URI
forceReportUpload POST  /enterprises/enterpriseId/users/userId/devices/deviceId/forceReportUpload 上传一份报告,其中包含自上次生成报告以来设备上应用状态发生的任何变化。对于给定设备,您每 24 小时最多可以调用此方法 3 次。
get GET  /enterprises/enterpriseId/users/userId/devices/deviceId 检索设备的详细信息。
getState GET  /enterprises/enterpriseId/users/userId/devices/deviceId/state 检索设备对 Google 服务的访问权限是已启用还是已停用。只有在 Google 管理控制台中启用了在 Android 设备上强制执行 EMM 政策时,设备状态才会生效。否则,系统会忽略设备状态,并允许所有设备访问 Google 服务。 只有由 Google 管理的用户支持此设置。
list GET  /enterprises/enterpriseId/users/userId/devices 检索用户所有设备的 ID。
setState PUT  /enterprises/enterpriseId/users/userId/devices/deviceId/state 设置是启用或停用设备对 Google 服务的访问权限。 只有在 Google 管理控制台中启用了在 Android 设备上强制执行 EMM 政策时,设备状态才会生效。否则,系统会忽略设备状态,并允许所有设备访问 Google 服务。 只有由 Google 管理的用户支持此设置。
update PUT  /enterprises/enterpriseId/users/userId/devices/deviceId 更新设备政策。

为确保正确实施此政策,您需要在 Google Play 软件包的受管理配置中设置 allowed_accounts,以防止非受管账号访问 Google Play。请参阅限制 Google Play 中的帐号

企业

如需详细了解 Enterprises 资源,请参阅资源表示形式页面。

方法 HTTP 请求 说明
除非另有说明,否则将使用相对于 https://www.googleapis.com/androidenterprise/v1 的 URI
acknowledgeNotificationSet POST  /enterprises/acknowledgeNotificationSet 确认从 Enterprises.PullNotificationSet 收到的通知,以防止后续调用返回相同的通知。
completeSignup POST  /enterprises/completeSignup 通过指定完成令牌和企业令牌来完成注册流程。对于给定的企业令牌,不得多次调用此请求。
createWebToken POST  /enterprises/enterpriseId/createWebToken 返回用于访问嵌入式界面的唯一令牌。如需生成网页界面,请将生成的令牌传递到 Google Play 企业版 JavaScript API。每个令牌只能用于启动一个界面会话。如需了解详情,请参阅 JavaScript API 文档
注册 POST  /enterprises/enroll 向发起调用的 EMM 注册企业。

必需的查询参数token

generateSignupUrl POST  /enterprises/signupUrl 生成注册网址。
get GET  /enterprises/enterpriseId 检索企业的名称和网域。
getServiceAccount GET  /enterprises/enterpriseId/serviceAccount 返回服务帐号和凭据。您可以通过调用 setAccount 将服务帐号绑定到企业。该服务帐号对此企业和 EMM 是唯一的,如果企业未绑定,该服务帐号将被删除。凭据包含私钥数据,且不存储在服务器端。

此方法只能在调用 Enterprises.enroll 或 Enterprises.CompleteSignup 之后、Enterprises.SetAccount 之前调用;有时,此方法会返回错误。

在第一次调用之后进行的后续调用将生成一组新的唯一凭据,并使之前生成的凭据失效。

将服务帐号绑定到企业后,可以使用 serviceAccountKeys 资源对其进行管理。
getStoreLayout GET  /enterprises/enterpriseId/storeLayout 返回企业的商店布局。如果未设置商店布局,则返回“basic”作为商店布局类型,而不返回首页。
list GET  /enterprises 按域名查找企业。 只有通过 Google 发起的创建流程创建的企业才支持这种做法。对于通过 EMM 启动的流程创建的企业,无需查找该 ID,因为 EMM 会在 Enterprises.generateSignupUrl 调用中指定的回调中获知企业 ID。

必需的查询参数domain

pullNotificationSet POST  /enterprises/pullNotificationSet 针对与针对该请求进行身份验证的服务帐号关联的企业,拉取并返回一组通知。如果没有待处理的通知,通知集可能为空。
除非通知集为空,否则需要在 20 秒内通过调用 Enterprises.AcknowledgeNotificationSet 予以确认。
未在 20 秒内确认的通知最终将再次包含在对另一个 PullNotificationSet 请求的响应中,而那些从未确认的通知将根据 Google Cloud Platform Pub/Sub 系统政策最终被删除。
系统可能会同时执行多个请求来检索通知,在这种情况下,待处理的通知(如果有)会在每个调用方之间拆分(如果有待处理的通知)。
如果不存在任何通知,则返回空的通知列表。 如果后续请求变得可用,则可能会返回更多通知。
sendTestPushNotification POST  /enterprises/enterpriseId/sendTestPushNotification 发送测试通知,验证 EMM 与此企业的 Google Cloud Pub/Sub 服务的集成。
setAccount PUT  /enterprises/enterpriseId/account 将用于向 API 进行身份验证的账号设置为企业。
setStoreLayout PUT  /enterprises/enterpriseId/storeLayout 设置企业的商店布局。默认情况下,storeLayoutType 设置为“basic”,基本存储空间布局处于启用状态。基本布局仅包含已由管理员批准且已通过 setAvailableProductSet 调用添加到用户的可用商品集的应用。此页面上的应用会按其产品 ID 值进行排序。如果您创建自定义商店布局(通过设置 storeLayoutType = "custom" 并设置首页),则基本商店布局会停用。
取消注册 POST  /enterprises/enterpriseId/unenroll 从发起调用的 EMM 中取消注册企业。

使用权

如需详细了解 Entitlements 资源,请参阅资源表示形式页面。

方法 HTTP 请求 说明
除非另有说明,否则将使用相对于 https://www.googleapis.com/androidenterprise/v1 的 URI
delete DELETE  /enterprises/enterpriseId/users/userId/entitlements/entitlementId 移除用户对应用的访问权限。 注意:此项已弃用。新的集成无法使用此方法,可参阅我们的 新建议
get GET  /enterprises/enterpriseId/users/userId/entitlements/entitlementId 检索使用权的详细信息。注意:此项已弃用。新的集成无法使用此方法,可参阅我们的 新建议
list GET  /enterprises/enterpriseId/users/userId/entitlements 列出指定用户的所有使用权。仅会设置 ID。 注意:此项已弃用。新的集成无法使用此方法,可参阅我们的 新建议
update PUT  /enterprises/enterpriseId/users/userId/entitlements/entitlementId 为用户添加或更新应用使用权。注意:此项已弃用。新的集成无法使用此方法,可参阅我们的 新建议

Grouplicenses(群组许可)

如需详细了解 Grouplicenses 资源,请参阅资源表示形式页面。

方法 HTTP 请求 说明
除非另有说明,否则将使用相对于 https://www.googleapis.com/androidenterprise/v1 的 URI
get GET  /enterprises/enterpriseId/groupLicenses/groupLicenseId 检索某个产品的企业群组许可详细信息。注意:此项已弃用。新的集成无法使用此方法,可参阅我们的 新建议
list GET  /enterprises/enterpriseId/groupLicenses 检索企业拥有群组许可的所有产品的 ID。注意:此项已弃用。新的集成无法使用此方法,可参阅我们的 新建议

Grouplicenseusers

如需详细了解 Grouplicenseusers 资源,请参阅资源表示形式页面。

方法 HTTP 请求 说明
除非另有说明,否则将使用相对于 https://www.googleapis.com/androidenterprise/v1 的 URI
list GET  /enterprises/enterpriseId/groupLicenses/groupLicenseId/users 检索根据该许可被授予使用权的用户的 ID。注意:此项已弃用。新的集成无法使用此方法,可参阅我们的 新建议

安装次数

如需详细了解 Installs 资源,请参阅资源表示形式页面。

方法 HTTP 请求 说明
除非另有说明,否则将使用相对于 https://www.googleapis.com/androidenterprise/v1 的 URI
delete DELETE  /enterprises/enterpriseId/users/userId/devices/deviceId/installs/installId 从设备中移除应用的请求。对 getlist 的调用仍会将应用显示为已安装在设备上,直到应用实际将其移除。
get GET  /enterprises/enterpriseId/users/userId/devices/deviceId/installs/installId 检索应用安装在设备上的详细信息。
list GET  /enterprises/enterpriseId/users/userId/devices/deviceId/installs 检索指定设备上安装的所有应用的详细信息。
update PUT  /enterprises/enterpriseId/users/userId/devices/deviceId/installs/installId 请求将最新版应用安装到设备上。如果该应用已安装,则会根据需要更新到最新版本。

设备的受管配置

如需详细了解 Managedconfigurationsfordevice 资源,请参阅资源表示形式页面。

方法 HTTP 请求 说明
除非另有说明,否则将使用相对于 https://www.googleapis.com/androidenterprise/v1 的 URI
delete DELETE  /enterprises/enterpriseId/users/userId/devices/deviceId/managedConfigurationsForDevice/managedConfigurationForDeviceId 针对指定设备移除应用的按设备管理的配置。
get GET  /enterprises/enterpriseId/users/userId/devices/deviceId/managedConfigurationsForDevice/managedConfigurationForDeviceId 检索每台设备的托管配置的详细信息。
list GET  /enterprises/enterpriseId/users/userId/devices/deviceId/managedConfigurationsForDevice 列出指定设备的所有单一设备托管配置。 仅会设置 ID。
update PUT  /enterprises/enterpriseId/users/userId/devices/deviceId/managedConfigurationsForDevice/managedConfigurationForDeviceId 为指定设备为应用添加或更新设备级管理配置。

用户受管配置

如需详细了解 Managedconfigurationsforuser 资源,请参阅资源表示形式页面。

方法 HTTP 请求 说明
除非另有说明,否则将使用相对于 https://www.googleapis.com/androidenterprise/v1 的 URI
delete DELETE  /enterprises/enterpriseId/users/userId/managedConfigurationsForUser/managedConfigurationForUserId 为指定用户移除应用的针对用户管理的配置。
get GET  /enterprises/enterpriseId/users/userId/managedConfigurationsForUser/managedConfigurationForUserId 针对指定用户,检索应用的针对用户管理的配置的详细信息。
list GET  /enterprises/enterpriseId/users/userId/managedConfigurationsForUser 列出指定用户的所有按用户管理的配置。仅会设置 ID。
update PUT  /enterprises/enterpriseId/users/userId/managedConfigurationsForUser/managedConfigurationForUserId 为指定用户添加或更新应用的受管配置设置。 如果您支持托管配置 iframe,则可以通过在请求中指定 mcmId 及其关联的配置变量(如果有)来将托管配置应用于用户。或者,所有 EMM 都可以通过传递受管理资源列表来应用受管理配置。

受管配置设置

如需详细了解 Managedconfigurationssettings 资源,请参阅资源表示形式页面。

方法 HTTP 请求 说明
除非另有说明,否则将使用相对于 https://www.googleapis.com/androidenterprise/v1 的 URI
list GET  /enterprises/enterpriseId/products/productId/managedConfigurationsSettings 列出指定应用的所有托管配置设置。

权限

有关 Permissions 资源的详细信息,请参阅资源表示形式页面。

方法 HTTP 请求 说明
除非另有说明,否则将使用相对于 https://www.googleapis.com/androidenterprise/v1 的 URI
get GET  /permissions/permissionId 检索 Android 应用权限的详细信息,以便向企业管理员显示。

产品

如需详细了解 Products 资源,请参阅资源表示形式页面。

方法 HTTP 请求 说明
除非另有说明,否则将使用相对于 https://www.googleapis.com/androidenterprise/v1 的 URI
批准 POST  /enterprises/enterpriseId/products/productId/approve

批准指定的商品和相关的应用权限(如果有)。 每个企业客户最多可以批准 1000 个产品。

如需了解如何使用 Google Play 企业版设计和创建商店布局,以便向用户展示已获批准的商品,请参阅商店布局设计

注意:此项已弃用。新的集成无法使用此方法,可参阅我们的 新建议
generateApprovalUrl POST  /enterprises/enterpriseId/products/productId/generateApprovalUrl 生成一个网址,该网址可在 iframe 中呈现,以显示商品的权限(如果有)。企业管理员必须查看这些权限并代表其组织接受这些权限,才能批准相应产品。

管理员应通过在 EMM 控制台中与单独的界面元素互动来接受显示的权限,这反过来又会触发在 Products.approve 调用中将此网址用作 approvalUrlInfo.approvalUrl 属性,以批准产品。 此网址最多只能用于显示 1 天内的权限。 注意:此项已弃用。新的集成无法使用此方法,可参阅我们的 新建议
get GET  /enterprises/enterpriseId/products/productId 检索要显示给企业管理员的产品详细信息。
getAppRestrictionsSchema GET  /enterprises/enterpriseId/products/productId/appRestrictionsSchema 检索用于定义此商品的可配置属性的架构。所有产品都有架构,但如果未定义托管配置,此架构可能为空。此架构可用于填充供管理员配置产品的界面。如需根据使用此 API 获取的架构应用托管配置,请参阅通过 Play 获取托管配置
getPermissions GET  /enterprises/enterpriseId/products/productId/permissions 检索此应用所需的 Android 应用权限。
list GET  /enterprises/enterpriseId/products 查找与查询匹配且已获批准的商品,或查找所有已获批准的商品(如果没有查询)。 注意:此项已弃用。新的集成无法使用此方法,可参阅我们的 新建议
取消批准 POST  /enterprises/enterpriseId/products/productId/unapprove 取消批准指定商品(以及相关的应用权限,如果有) 注意:此商品已弃用。新的集成无法使用此方法,可参阅我们的 新建议

服务帐号密钥

如需详细了解 Serviceaccountkeys 资源,请参阅资源表示形式页面。

方法 HTTP 请求 说明
除非另有说明,否则将使用相对于 https://www.googleapis.com/androidenterprise/v1 的 URI
delete DELETE  /enterprises/enterpriseId/serviceAccountKeys/keyId 移除与此企业关联的服务帐号的指定凭据,并使其失效。调用服务帐号必须是通过调用 Enterprises.GetServiceAccount 检索到的,并且必须通过调用 Enterprises.SetAccount 设置为企业服务帐号。
插入 POST  /enterprises/enterpriseId/serviceAccountKeys 为与此企业关联的服务帐号生成新凭据。调用方服务帐号必须通过调用 Enterprises.GetServiceAccount 进行检索,并且必须通过调用 Enterprises.SetAccount 设置为企业服务帐号。

在要插入的资源中,只应填充键的类型。
list GET  /enterprises/enterpriseId/serviceAccountKeys 列出与此企业关联的服务帐号的所有有效凭据。仅返回 ID 和密钥类型。调用服务帐号必须通过调用 Enterprises.GetServiceAccount 来检索,并且必须通过调用 Enterprises.SetAccount 设置为企业服务帐号。

Storelayoutclusters

如需详细了解 Storelayoutclusters 资源,请参阅资源表示形式页面。

方法 HTTP 请求 说明
除非另有说明,否则将使用相对于 https://www.googleapis.com/androidenterprise/v1 的 URI
delete DELETE  /enterprises/enterpriseId/storeLayout/pages/pageId/clusters/clusterId 删除集群。
get GET  /enterprises/enterpriseId/storeLayout/pages/pageId/clusters/clusterId 检索集群的详细信息。
插入 POST  /enterprises/enterpriseId/storeLayout/pages/pageId/clusters 在页面中插入新集群。
list GET  /enterprises/enterpriseId/storeLayout/pages/pageId/clusters 检索指定页面上所有集群的详细信息。
update PUT  /enterprises/enterpriseId/storeLayout/pages/pageId/clusters/clusterId 更新集群。

Storelayoutpages

如需详细了解 Storelayoutpages 资源,请参阅资源表示形式页面。

方法 HTTP 请求 说明
除非另有说明,否则将使用相对于 https://www.googleapis.com/androidenterprise/v1 的 URI
delete DELETE  /enterprises/enterpriseId/storeLayout/pages/pageId 删除商店页面。
get GET  /enterprises/enterpriseId/storeLayout/pages/pageId 检索商店页面的详细信息。
插入 POST  /enterprises/enterpriseId/storeLayout/pages 插入新的商店页面。
list GET  /enterprises/enterpriseId/storeLayout/pages 检索存储区中所有页面的详细信息。
update PUT  /enterprises/enterpriseId/storeLayout/pages/pageId 更新商店页面的内容。

用户

如需详细了解用户资源,请参阅资源表示形式页面。

方法 HTTP 请求 说明
除非另有说明,否则将使用相对于 https://www.googleapis.com/androidenterprise/v1 的 URI
delete DELETE  /enterprises/enterpriseId/users/userId 删除了受 EMM 管理的用户。
generateAuthenticationToken POST  /enterprises/enterpriseId/users/userId/authenticationToken 生成一个身份验证令牌,设备政策客户端可使用该令牌在设备上预配指定的 EMM 管理的用户帐号。生成的令牌是一次性令牌,会在几分钟后过期。

您最多可以为每位用户配置 10 台设备。

此通话仅适用于由 EMM 管理的账号。
get GET  /enterprises/enterpriseId/users/userId 检索用户的详细信息。
getAvailableProductSet GET  /enterprises/enterpriseId/users/userId/availableProductSet 检索用户有权访问的一组商品。
插入 POST  /enterprises/enterpriseId/users 创建由 EMM 管理的新用户。

在请求正文中传递的 Users 资源应包含 accountIdentifieraccountType

如果已存在具有相同帐号标识符的对应用户,将使用资源更新该用户。在这种情况下,只能更改 displayName 字段。

list GET  /enterprises/enterpriseId/users 按主电子邮件地址查找用户。 只有由 Google 管理的用户支持此设置。受 EMM 管理的用户无需查找此 ID,因为相应 ID 已在 Users.insert 调用的结果中返回。

必需的查询参数email

revokeDeviceAccess DELETE  /enterprises/enterpriseId/users/userId/deviceAccess 撤消对目前已配置给用户的设备的访问权限。用户将无法再在其任何受管设备上使用 Play 企业版商店。

此通话仅适用于由 EMM 管理的账号。
setAvailableProductSet PUT  /enterprises/enterpriseId/users/userId/availableProductSet 修改用户有权访问的一组商品(称为已列入白名单的商品)。whitelisted只有获批或之前已获批准(被撤消审批的产品)的产品才能列入白名单。注意:此项已弃用。新的集成无法使用此方法,可参阅我们的 新建议
update PUT  /enterprises/enterpriseId/users/userId 更新由 EMM 管理的用户的详细信息。

只能与受 EMM 管理的用户(而非由 Google 管理的用户)搭配使用。 在请求正文中的 Users 资源中传递新详细信息。只能更改 displayName 字段。其他字段必须未设置或具有当前有效值。

Web 应用

如需详细了解 Webapps 资源,请参阅资源表示形式页面。

方法 HTTP 请求 说明
除非另有说明,否则将使用相对于 https://www.googleapis.com/androidenterprise/v1 的 URI
delete DELETE  /enterprises/enterpriseId/webApps/webAppId 删除现有 Web 应用。
get GET  /enterprises/enterpriseId/webApps/webAppId 获取现有 Web 应用。
插入 POST  /enterprises/enterpriseId/webApps 为企业创建新的 Web 应用。
list GET  /enterprises/enterpriseId/webApps 检索指定企业的所有 Web 应用的详细信息。
update PUT  /enterprises/enterpriseId/webApps/webAppId 更新现有 Web 应用。