Method: groups.list
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
ドメインまたはユーザーキーを指定して、そのドメインまたはユーザーのすべてのグループを取得します(ページネーションあり)。
HTTP リクエスト
GET https://admin.googleapis.com/admin/directory/v1/groups
この URL は gRPC Transcoding 構文を使用します。
クエリ パラメータ
パラメータ |
customer |
string
お客様の Google Workspace アカウントの一意の ID。複数ドメインのアカウントで、お客様のすべてのグループを取得するには、domain ではなくこのフィールドを使用します。my_customer エイリアスを使用してアカウントの customerId を表すこともできます。customerId は、Users リソースの一部として返されます。customer パラメータまたは domain パラメータのいずれかを指定する必要があります。
|
domain |
string
ドメイン名。このフィールドを使用して、1 つのドメインからのみグループを取得します。お客様のアカウントのすべてのドメインを返すには、代わりに customer クエリ パラメータを使用します。
|
maxResults |
integer
返される結果の最大数。最大値は 200 です。
|
orderBy |
enum (OrderBy )
結果の並べ替えに使用する列
|
pageToken |
string
リストの次のページを指定するトークン
|
query |
string
クエリ文字列検索。「」の形式にする必要があります。詳細なドキュメントは、https: //developers.google.com/workspace/admin/directory/v1/guides/search-groups をご覧ください。
|
sortOrder |
enum (SortOrder )
結果を昇順または降順のどちらで返すかを指定します。orderBy も使用されている場合にのみ使用
|
userKey |
string
指定したユーザーがメンバーであるグループのみを一覧表示する場合は、そのユーザーのメールアドレスまたは不変 ID。ID の場合は、ユーザー オブジェクトの ID と一致している必要があります。customer パラメータでは使用できません。
|
リクエストの本文
リクエストの本文は空にする必要があります。
レスポンスの本文
成功すると、レスポンスの本文に次の構造のデータが含まれます。
JSON 表現 |
{
"kind": string,
"etag": string,
"groups": [
{
object (Group )
}
],
"nextPageToken": string
} |
フィールド |
kind |
string
リソースの種類。
|
etag |
string
リソースの ETag。
|
groups[] |
object (Group )
グループ オブジェクトのリスト。
|
nextPageToken |
string
この結果の次のページにアクセスするために使用されるトークン。
|
認可スコープ
以下のいずれかの 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.readonly
詳しくは、認可ガイドをご覧ください。
SortOrder
列挙型 |
ASCENDING |
昇順。 |
DESCENDING |
降順。 |
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-25 UTC。
[null,null,["最終更新日 2025-07-25 UTC。"],[],[],null,["# Method: groups.list\n\nRetrieves all groups of a domain or of a user given a userKey (paginated).\n\n### HTTP request\n\n`GET https://admin.googleapis.com/admin/directory/v1/groups`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `customer` | `string` The unique ID for the customer's Google Workspace account. In case of a multi-domain account, to fetch all groups for a customer, use this field instead of `domain`. You can also use the `my_customer` alias to represent your account's `customerId`. The `customerId` is also returned as part of the [Users](https://developers.google.com/workspace/admin/directory/v1/reference/users) resource. You must provide either the `customer` or the `domain` parameter. |\n| `domain` | `string` The domain name. Use this field to get groups from only one domain. To return all domains for a customer account, use the `customer` query parameter instead. |\n| `maxResults` | `integer` Maximum number of results to return. Max allowed value is 200. |\n| `orderBy` | `enum (`[OrderBy](/workspace/admin/directory/reference/rest/v1/groups/list#OrderBy)`)` Column to use for sorting results |\n| `pageToken` | `string` Token to specify next page in the list |\n| `query` | `string` Query string search. Should be of the form \"\". Complete documentation is at https: //developers.google.com/workspace/admin/directory/v1/guides/search-groups |\n| `sortOrder` | `enum (`[SortOrder](/workspace/admin/directory/reference/rest/v1/groups/list#SortOrder)`)` Whether to return results in ascending or descending order. Only of use when orderBy is also used |\n| `userKey` | `string` Email or immutable ID of the user if only those groups are to be listed, the given user is a member of. If it's an ID, it should match with the ID of the user object. Cannot be used with the `customer` parameter. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"kind\": string, \"etag\": string, \"groups\": [ { object (/workspace/admin/directory/reference/rest/v1/groups#Group) } ], \"nextPageToken\": string } ``` |\n\n| Fields ||\n|-----------------|----------------------------------------------------------------------------------------------------------|\n| `kind` | `string` Kind of resource this is. |\n| `etag` | `string` ETag of the resource. |\n| `groups[]` | `object (`[Group](/workspace/admin/directory/reference/rest/v1/groups#Group)`)` A list of group objects. |\n| `nextPageToken` | `string` Token used to access next page of this result. |\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.readonly`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent).\n\nOrderBy\n-------\n\n| Enums ||\n|---------|---------------------|\n| `EMAIL` | Email of the group. |\n\nSortOrder\n---------\n\n| Enums ||\n|--------------|-------------------|\n| `ASCENDING` | Ascending order. |\n| `DESCENDING` | Descending order. |"]]