Method: members.hasMember
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
指定されたユーザーがグループのメンバーかどうかを確認します。メンバーシップは直接的またはネストされたものになりますが、ネストされている場合、memberKey
と groupKey
は同じドメイン内のエンティティである必要があります。そうでない場合、Invalid input
エラーが返されます。グループのドメイン外のエンティティを含むネストされたメンバーシップを確認するには、Cloud Identity Groups API の checkTransitiveMembership()
メソッドを使用します。
HTTP リクエスト
GET https://admin.googleapis.com/admin/directory/v1/groups/{groupKey}/hasMember/{memberKey}
この URL は gRPC Transcoding 構文を使用します。
パスパラメータ
パラメータ |
groupKey |
string
API リクエスト内でグループを識別します。値には、グループのメールアドレス、グループ エイリアス、一意のグループ ID を指定できます。
|
memberKey |
string
API リクエスト内のユーザー メンバーを識別します。この値は、ユーザーのメインのメールアドレス、エイリアス、一意の ID のいずれかです。
|
リクエストの本文
リクエストの本文は空にする必要があります。
レスポンスの本文
Directory API の Has Member レスポンスの JSON テンプレート。
成功した場合、レスポンスの本文には次の構造のデータが含まれます。
JSON 表現 |
{
"isMember": boolean
} |
フィールド |
isMember |
boolean
出力専用。指定したユーザーがグループのメンバーかどうかを特定します。メンバーシップは直接的またはネストされたものになります。
|
認可スコープ
以下のいずれかの OAuth スコープが必要です。
https://apps-apis.google.com/a/feeds/groups/
https://www.googleapis.com/auth/admin.directory.group
https://www.googleapis.com/auth/admin.directory.group.member
https://www.googleapis.com/auth/admin.directory.group.member.readonly
https://www.googleapis.com/auth/admin.directory.group.readonly
詳しくは、認可ガイドをご覧ください。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-25 UTC。
[null,null,["最終更新日 2025-07-25 UTC。"],[],[],null,["# Method: members.hasMember\n\nChecks whether the given user is a member of the group. Membership can be direct or nested, but if nested, the `memberKey` and `groupKey` must be entities in the same domain or an `Invalid input` error is returned. To check for nested memberships that include entities outside of the group's domain, use the [`checkTransitiveMembership()`](https://cloud.google.com/identity/docs/reference/rest/v1/groups.memberships/checkTransitiveMembership) method in the Cloud Identity Groups API.\n\n### HTTP request\n\n`GET https://admin.googleapis.com/admin/directory/v1/groups/{groupKey}/hasMember/{memberKey}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|-------------|------------------------------------------------------------------------------------------------------------------------------------|\n| `groupKey` | `string` Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID. |\n| `memberKey` | `string` Identifies the user member in the API request. The value can be the user's primary email address, alias, or unique ID. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nJSON template for Has Member response in Directory API.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|---------------------------------|\n| ``` { \"isMember\": boolean } ``` |\n\n| Fields ||\n|------------|------------------------------------------------------------------------------------------------------------------------|\n| `isMember` | `boolean` Output only. Identifies whether the given user is a member of the group. Membership can be direct or nested. |\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://apps-apis.google.com/a/feeds/groups/`\n- `\n https://www.googleapis.com/auth/admin.directory.group`\n- `\n https://www.googleapis.com/auth/admin.directory.group.member`\n- `\n https://www.googleapis.com/auth/admin.directory.group.member.readonly`\n- `\n https://www.googleapis.com/auth/admin.directory.group.readonly`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]