Method: contactGroups.list
Stay organized with collections
Save and categorize content based on your preferences.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-08-06 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-06 UTC."],[[["\u003cp\u003eLists all contact groups owned by the authenticated user, without populating group members.\u003c/p\u003e\n"],["\u003cp\u003eAllows for pagination and filtering of results using query parameters such as \u003ccode\u003epageToken\u003c/code\u003e, \u003ccode\u003epageSize\u003c/code\u003e, \u003ccode\u003esyncToken\u003c/code\u003e, and \u003ccode\u003egroupFields\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eRequires authorization with either \u003ccode\u003ehttps://www.googleapis.com/auth/contacts\u003c/code\u003e or \u003ccode\u003ehttps://www.googleapis.com/auth/contacts.readonly\u003c/code\u003e scopes.\u003c/p\u003e\n"],["\u003cp\u003eReturns a response containing an array of contact groups, total item count, and tokens for pagination and synchronization.\u003c/p\u003e\n"],["\u003cp\u003eThe request body should be empty and the response body contains contact group details in JSON format.\u003c/p\u003e\n"]]],["This describes how to list a user's contact groups via the People API. A `GET` request to `https://people.googleapis.com/v1/contactGroups` is made, with an empty request body. Optional query parameters (`pageToken`, `pageSize`, `syncToken`, `groupFields`) allow for pagination, syncing changes, and field restriction. The response includes an array of `contactGroups`, total item count, and tokens for subsequent pages or syncing. The operation requires specific authorization scopes.\n"],null,["- [HTTP request](#body.HTTP_TEMPLATE)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.ListContactGroupsResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nList all contact groups owned by the authenticated user. Members of the contact groups are not populated.\n\nHTTP request\n\n`GET https://people.googleapis.com/v1/contactGroups`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\nQuery parameters\n\n| Parameters ||\n|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `pageToken` | `string` Optional. The nextPageToken value returned from a previous call to [contactGroups.list](/people/api/rest/v1/contactgroups/list). Requests the next page of resources. |\n| `pageSize` | `integer` Optional. The maximum number of resources to return. Valid values are between 1 and 1000, inclusive. Defaults to 30 if not set or set to 0. |\n| `syncToken` | `string` Optional. A sync token, returned by a previous call to `contactgroups.list`. Only resources changed since the sync token was created will be returned. |\n| `groupFields` | `string (`[FieldMask](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask)` format)` Optional. A field mask to restrict which fields on the group are returned. Defaults to `metadata`, `groupType`, `memberCount`, and `name` if not set or set to empty. Valid fields are: - clientData - groupType - memberCount - metadata - name |\n\nRequest body\n\nThe request body must be empty.\n\nResponse body The response to a list contact groups request.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"contactGroups\": [ { object (/people/api/rest/v1/contactGroups#ContactGroup) } ], \"totalItems\": integer, \"nextPageToken\": string, \"nextSyncToken\": string } ``` |\n\n| Fields ||\n|-------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `contactGroups[]` | `object (`[ContactGroup](/people/api/rest/v1/contactGroups#ContactGroup)`)` The list of contact groups. Members of the contact groups are not populated. |\n| `totalItems` | `integer` The total number of items in the list without pagination. |\n| `nextPageToken` | `string` The token that can be used to retrieve the next page of results. |\n| `nextSyncToken` | `string` The token that can be used to retrieve changes since the last request. |\n\nAuthorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/contacts`\n- `https://www.googleapis.com/auth/contacts.readonly`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]