Method: contactGroups.batchGet
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.
[null,null,["Last updated 2024-08-06 UTC."],[[["\u003cp\u003eRetrieves a list of contact groups owned by the authenticated user using their resource names.\u003c/p\u003e\n"],["\u003cp\u003eAllows specifying the maximum number of members to return for each group and the fields to include in the response.\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 scope.\u003c/p\u003e\n"],["\u003cp\u003eReturns a list of responses, each containing the requested resource name, status, and the contact group details if successful.\u003c/p\u003e\n"],["\u003cp\u003eUses a batch get request to the endpoint \u003ccode\u003ehttps://people.googleapis.com/v1/contactGroups:batchGet\u003c/code\u003e.\u003c/p\u003e\n"]]],["This API allows retrieving multiple contact groups owned by the authenticated user via a `GET` request to `https://people.googleapis.com/v1/contactGroups:batchGet`. You must provide a list of `resourceNames` (up to 200) in the query parameters. The `maxMembers` and `groupFields` parameters are optional. The request body is empty. The successful response contains a list of `ContactGroupResponse` objects, each containing a contact group, its requested resource name, and status. Authorization requires either `contacts` or `contacts.readonly` scopes.\n"],null,["# Method: contactGroups.batchGet\n\n- [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.BatchGetContactGroupsResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [ContactGroupResponse](#ContactGroupResponse)\n - [JSON representation](#ContactGroupResponse.SCHEMA_REPRESENTATION)\n- [Try it!](#try-it)\n\nGet a list of contact groups owned by the authenticated user by specifying a list of contact group resource names.\n\n### HTTP request\n\n`GET https://people.googleapis.com/v1/contactGroups:batchGet`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|-------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `resourceNames[]` | `string` Required. The resource names of the contact groups to get. There is a maximum of 200 resource names. |\n| `maxMembers` | `integer` Optional. Specifies the maximum number of members to return for each group. Defaults to 0 if not set, which will return zero members. |\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\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nThe response to a batch get contact groups request.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|-----------------------------------------------------------------------------------------------------------|\n| ``` { \"responses\": [ { object (/people/api/rest/v1/contactGroups/batchGet#ContactGroupResponse) } ] } ``` |\n\n| Fields ||\n|---------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `responses[]` | `object (`[ContactGroupResponse](/people/api/rest/v1/contactGroups/batchGet#ContactGroupResponse)`)` The list of responses for each requested contact group resource. |\n\n### Authorization 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).\n\nContactGroupResponse\n--------------------\n\nThe response for a specific contact group.\n\n| JSON representation |\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"requestedResourceName\": string, \"status\": { object (/people/api/rest/v1/Status) }, \"contactGroup\": { object (/people/api/rest/v1/contactGroups#ContactGroup) } } ``` |\n\n| Fields ||\n|-------------------------|------------------------------------------------------------------------------------------------|\n| `requestedResourceName` | `string` The original requested resource name. |\n| `status` | `object (`[Status](/people/api/rest/v1/Status)`)` The status of the response. |\n| `contactGroup` | `object (`[ContactGroup](/people/api/rest/v1/contactGroups#ContactGroup)`)` The contact group. |"]]