Method: spaces.members.create
呼び出し元の Chat アプリ、ユーザー、Google グループのメンバーシップを作成します。他の Chat アプリのメンバーシップの作成はサポートされていません。メンバーシップを作成するときに、指定したメンバーの自動承認ポリシーがオフになっている場合、そのメンバーは招待され、スペースへの参加前に招待を承諾する必要があります。それ以外の場合は、メンバーシップを作成すると、指定されたスペースにメンバーが直接追加されます。
次のタイプの認証をサポートしています。
使用例については、以下をご覧ください。
HTTP リクエスト
POST https://chat.googleapis.com/v1/{parent=spaces/*}/members
この URL は gRPC Transcoding 構文を使用します。
パスパラメータ
パラメータ |
parent |
string
必須。メンバーシップを作成する Space のリソース名。 形式: spaces/{space}
|
クエリ パラメータ
パラメータ |
useAdminAccess |
boolean
省略可。true の場合、メソッドはユーザーの Google Workspace 管理者権限を使用して実行されます。 呼び出し元のユーザーは、Chat とスペースの会話の管理権限を持つ 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 Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-02-27 UTC。
[null,null,["最終更新日 2025-02-27 UTC。"],[[["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"]]