Method: users.settings.cse.identities.create
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
创建和配置一个有权从用户账号发送邮件的客户端加密身份。Google 会将 S/MIME 证书发布到共享的网域级目录,以便 Google Workspace 组织中的用户可以加密并向该身份发送邮件。
对于管理组织中用户身份和密钥对的管理员,请求需要使用具有全网域授权的服务账号进行授权,才能模拟具有 https://www.googleapis.com/auth/gmail.settings.basic
范围的用户。
对于管理自己的身份和密钥对的用户,请求需要开启并配置硬件密钥加密。
HTTP 请求
POST https://gmail.googleapis.com/gmail/v1/users/{userId}/settings/cse/identities
网址采用 gRPC 转码语法。
路径参数
参数 |
userId |
string
请求者的主电子邮件地址。如需指明已通过身份验证的用户,您可以使用特殊值 me 。
|
请求正文
请求正文包含一个 CseIdentity
实例。
响应正文
如果成功,响应正文将包含一个新创建的 CseIdentity
实例。
授权范围
需要以下 OAuth 范围之一:
https://www.googleapis.com/auth/gmail.settings.basic
https://www.googleapis.com/auth/gmail.settings.sharing
如需了解详情,请参阅授权指南。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[],[],null,["# Method: users.settings.cse.identities.create\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nCreates and configures a client-side encryption identity that's authorized to send mail from the user account. Google publishes the S/MIME certificate to a shared domain-wide directory so that people within a Google Workspace organization can encrypt and send mail to the identity.\n\nFor administrators managing identities and keypairs for users in their organization, requests require authorization with a [service account](https://developers.google.com/identity/protocols/OAuth2ServiceAccount) that has [domain-wide delegation authority](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#delegatingauthority) to impersonate users with the `https://www.googleapis.com/auth/gmail.settings.basic` scope.\n\nFor users managing their own identities and keypairs, requests require [hardware key encryption](https://support.google.com/a/answer/14153163) turned on and configured.\n\n### HTTP request\n\n`POST https://gmail.googleapis.com/gmail/v1/users/{userId}/settings/cse/identities`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------|-------------------------------------------------------------------------------------------------------------------------|\n| `userId` | `string` The requester's primary email address. To indicate the authenticated user, you can use the special value `me`. |\n\n### Request body\n\nThe request body contains an instance of [CseIdentity](/workspace/gmail/api/reference/rest/v1/users.settings.cse.identities#CseIdentity).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [CseIdentity](/workspace/gmail/api/reference/rest/v1/users.settings.cse.identities#CseIdentity).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/gmail.settings.basic`\n- `\n https://www.googleapis.com/auth/gmail.settings.sharing`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]