如需指定要添加的真人成员,请使用适当的 membership.member.name 添加成员资格。如需添加真人用户,请使用 users/{user},其中 {user} 可以是用户的电子邮件地址。对于同一 Workspace 组织中的用户,{user} 还可以是 People API 中人员的 id,或 Directory API 中用户的 id。例如,如果 user@example.com 的 People API 人员个人资料 ID 为 123456789,您可以将 membership.member.name 设置为 users/user@example.com 或 users/123456789,将该用户添加到聊天室。
如需指定要添加的 Google 群组,请使用相应的 membership.group_member.name 添加成员资格。如需添加或邀请 Google 群组,请使用 groups/{group},其中 {group} 是 Cloud Identity Groups API 中相应群组的 id。例如,您可以使用 Cloud Identity Groups lookup API 检索群组电子邮件地址 group@example.com 的 ID 123456789,然后通过将 membership.group_member.name 设置为 groups/123456789 将群组添加到聊天室。不支持群组电子邮件地址,并且 Google 群组只能作为成员添加到命名聊天室中。
[null,null,["最后更新时间 (UTC):2025-02-27。"],[[["Creates a new space in Google Chat and adds specified users or Google Groups."],["Supports creating spaces, group chats, and direct messages (DMs), including DMs with the calling app."],["Requires specifying the space type, display name (for spaces only), and memberships for users or groups to be added."],["Automatically adds the calling user to the space and does not support adding Chat apps except in DMs with the calling app."],["Requires user authentication with specific OAuth scopes for authorization."]]],["This content describes how to create spaces and add members in Google Chat. Key actions include: sending a `POST` request to `https://chat.googleapis.com/v1/spaces:setup` with a request body containing a `space` object (specifying space type and details), an optional `requestId`, and an array of `memberships` to define users or groups to invite. Users are identified by their email or ID, and groups by their ID. Different `spaceType` are used to create a space, a group chat or a direct message. Authorization requires specific OAuth scopes.\n"]]