如要指定要新增的人類成員,請使用適當的 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 群組只能新增為已命名聊天室的成員。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2024-12-22 (世界標準時間)。"],[[["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"]]