Method: spaces.members.create
为发起通话的 Chat 应用、用户或 Google 群组创建会员资格。不支持为其他聊天应用创建成员资格。创建会员资格时,如果指定会员的自动接受政策处于关闭状态,那么在收到邀请后,他们必须先接受聊天室邀请,然后才能加入。否则,创建会员资格会直接将成员添加到指定聊天室。
支持以下类型的身份验证:
如需查看用法示例,请参阅:
HTTP 请求
POST https://chat.googleapis.com/v1/{parent=spaces/*}/members
网址采用 gRPC 转码语法。
路径参数
参数 |
parent |
string
必需。要为其创建成员资格的聊天室的资源名称。 格式:spaces/{space}
|
查询参数
参数 |
useAdminAccess |
boolean
可选。如果为 true ,则该方法会使用用户的 Google Workspace 管理员权限运行。 发起通话的用户必须是拥有管理聊天和聊天室对话权限的 Google Workspace 管理员。 需要 chat.admin.memberships OAuth 2.0 范围。 使用管理员权限创建应用会员资格或为管理员 Google Workspace 组织之外的用户创建会员资格不受支持。
|
请求正文
请求正文包含一个 Membership
实例。
响应正文
如果成功,响应正文将包含一个新创建的 Membership
实例。
授权范围
需要以下 OAuth 范围之一:
https://www.googleapis.com/auth/chat.app.memberships
https://www.googleapis.com/auth/chat.admin.memberships
https://www.googleapis.com/auth/chat.import
https://www.googleapis.com/auth/chat.memberships
https://www.googleapis.com/auth/chat.memberships.app
如需了解详情,请参阅授权指南。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-11-12。
[null,null,["最后更新时间 (UTC):2024-11-12。"],[[["Creates memberships for the calling Chat app, a user, or a Google Group in a specified space."],["Supports app authentication (with admin approval in Developer Preview) and user authentication (with optional admin access)."],["To use administrator privileges, set the `useAdminAccess` query parameter to `true` and ensure the user has the required permissions and scope."],["Requires specific OAuth scopes for authorization, such as `chat.app.memberships` or `chat.admin.memberships`."],["If the member has auto-accept turned off, an invitation is sent; otherwise, they are directly added to the space."]]],["This describes how to create a membership in Google Chat spaces using a `POST` request to `https://chat.googleapis.com/v1/{parent=spaces/*}/members`. Memberships can be created for a Chat app, user, or Google Group. Authentication supports app or user access, with optional administrator privileges via the `useAdminAccess` query parameter. The request includes path and query parameters and a `Membership` object in the body; the response returns the newly created `Membership`. Authorization requires specific OAuth scopes.\n"]]