重要提示:我们不再接受 Play EMM API 的新注册。
了解详情。
Users: insert
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
创建由 EMM 管理的新用户。
Users 资源
应包括一个
accountIdentifier
和 accountType
。
如果已存在具有相同账号标识符的相应用户,
系统就会使用相应资源更新用户在此例中,只有
displayName
字段可以更改。
请求
HTTP 请求
POST https://www.googleapis.com/androidenterprise/v1/enterprises/enterpriseId/users
参数
参数名称 |
值 |
说明 |
路径参数 |
enterpriseId |
string |
企业的 ID。
|
授权
此请求需要获得以下范围的授权:
范围 |
https://www.googleapis.com/auth/androidenterprise |
如需了解详情,请参阅身份验证和授权页面。
请求正文
在请求正文中,提供具有以下属性的 Users 资源:
属性名称 |
值 |
说明 |
备注 |
必需属性 |
accountIdentifier |
string |
您为此用户创建的唯一标识符,例如“user342”或“asset#44418”。请勿为此媒体资源使用个人身份信息 (PII)。必须始终为受 EMM 管理的用户设置。此设置不适用于由 Google 管理的用户。 |
|
accountType |
string |
此用户所代表的账号类型。userAccount 可以安装在多部设备上,但 deviceAccount 是特定于单个设备的。受 EMM 管理的用户 (emmManaged ) 可以是任一类型(userAccount 、deviceAccount ),但由 Google 管理的用户 (googleManaged ) 始终为 userAccount 。
可接受的值包括:
<ph type="x-smartling-placeholder"></ph>
- “
deviceAccount ”
- “
userAccount ”
|
|
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eCreates or updates an EMM-managed user within a specified enterprise.\u003c/p\u003e\n"],["\u003cp\u003eRequires an \u003ccode\u003eaccountIdentifier\u003c/code\u003e and \u003ccode\u003eaccountType\u003c/code\u003e to define the user.\u003c/p\u003e\n"],["\u003cp\u003eUses a POST request to the \u003ccode\u003e/enterprises/enterpriseId/users\u003c/code\u003e endpoint.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003edisplayName\u003c/code\u003e is the only field that can be updated for existing users.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization with the \u003ccode\u003ehttps://www.googleapis.com/auth/androidenterprise\u003c/code\u003e scope is necessary.\u003c/p\u003e\n"]]],[],null,["# Users: insert\n\n| **Note:** Requires [authorization](#auth).\n\nCreates a new EMM-managed user.\n\n\u003cbr /\u003e\n\n\nThe [Users](/android/work/play/emm-api/v1/users) resource\npassed in the body of the request should include an\n`accountIdentifier` and an `accountType`.\n\nIf a corresponding user already exists with the same account identifier,\nthe user will be updated with the resource. In this case only the\n`displayName` field can be changed.\n\n\u003cbr /\u003e\n\nRequest\n-------\n\n### HTTP request\n\n```\nPOST https://www.googleapis.com/androidenterprise/v1/enterprises/enterpriseId/users\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 a [Users resource](/android/work/play/emm-api/v1/users#resource) with the following properties:\n\n| Property name | Value | Description | Notes |\n|---------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------|\n| **Required Properties** ||||\n| `accountIdentifier` | `string` | A unique identifier you create for this user, such as \"user342\" or \"asset#44418\". Do not use personally identifiable information (PII) for this property. Must always be set for EMM-managed users. Not set for Google-managed users. | |\n| `accountType` | `string` | The type of account that this user represents. A `userAccount` can be installed on multiple devices, but a `deviceAccount` is specific to a single device. An EMM-managed user (`emmManaged`) can be either type (`userAccount`, `deviceAccount`), but a Google-managed user (`googleManaged`) is always a `userAccount`. \u003cbr /\u003e Acceptable values are: - \"`deviceAccount`\" - \"`userAccount`\" | |\n\nResponse\n--------\n\nIf successful, this method returns a [Users resource](/android/work/play/emm-api/v1/users#resource) in the response body."]]