Method: spaces.members.create
為通話 Chat 應用程式、使用者或 Google 群組建立會員資格。不支援建立其他 Chat 應用程式的會員。建立會員資格時,如果指定成員已停用自動接受政策,則他們會收到邀請,必須接受空間邀請才能加入。否則,建立會員資格會直接將成員新增至指定的聊天室。
支援下列類型的驗證:
如需使用範例,請參閱:
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
詳情請參閱授權指南。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-02-27 (世界標準時間)。
[null,null,["上次更新時間:2025-02-27 (世界標準時間)。"],[[["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"]]