Method: spaces.members.create

為通話 Chat 應用程式、使用者或 Google 群組建立會員資格。不支援建立其他 Chat 應用程式的會員。建立會員資格時,如果指定成員已停用自動接受政策,則他們必須先接受空間邀請,才能加入。否則,建立會員資格後,系統會直接將成員新增至指定的聊天室。

支援下列類型的驗證

  • 開發人員預覽版中,使用管理員核准應用程式驗證和授權範圍:

    • https://www.googleapis.com/auth/chat.app.memberships
  • 使用下列其中一個授權範圍進行使用者驗證

    • https://www.googleapis.com/auth/chat.memberships
    • https://www.googleapis.com/auth/chat.memberships.app (將通話應用程式新增至聊天室)
    • https://www.googleapis.com/auth/chat.import (僅限匯入模式聊天室)
    • 當管理員帳戶進行驗證、useAdminAccesstrue,且使用下列授權範圍時,使用者驗證會授予管理員權限:
      • https://www.googleapis.com/auth/chat.admin.memberships

如需使用範例,請參閱:

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

詳情請參閱授權指南