Method: otherContacts.search
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2024-08-06 UTC.
[null,null,["Ostatnia aktualizacja: 2024-08-06 UTC."],[[["\u003cp\u003eThis endpoint allows you to search for contacts within the authenticated user's other contacts using a plain-text query.\u003c/p\u003e\n"],["\u003cp\u003eThe search query matches on contact names, email addresses, and phone numbers from the OTHER_CONTACT source.\u003c/p\u003e\n"],["\u003cp\u003eResults can be limited using the \u003ccode\u003epageSize\u003c/code\u003e parameter, and specific fields can be selected using the \u003ccode\u003ereadMask\u003c/code\u003e parameter.\u003c/p\u003e\n"],["\u003cp\u003eA warmup request with an empty query should be sent before searching to update the cache for optimal performance.\u003c/p\u003e\n"],["\u003cp\u003eRequires authorization with the \u003ccode\u003ehttps://www.googleapis.com/auth/contacts.other.readonly\u003c/code\u003e scope.\u003c/p\u003e\n"]]],["This outlines searching for contacts within a user's \"other contacts.\" Key actions include sending a `GET` request to `https://people.googleapis.com/v1/otherContacts:search`. A `query` parameter, `pageSize`, and `readMask` are used to specify the search criteria, result count, and the returned contact fields. The request body must be empty, and the search matches names, email addresses, and phone numbers. An empty \"warmup\" request should be sent prior. The response body contains search results, and authorization requires the `contacts.other.readonly` scope.\n"],null,["# Method: otherContacts.search\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- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nProvides a list of contacts in the authenticated user's other contacts that matches the search query. The query matches on a contact's `names`, `emailAddresses`, and `phoneNumbers` fields that are from the [OTHER_CONTACT](/people/api/rest/v1/people#Person.SourceType) source.\n\n**IMPORTANT** : Before searching, clients should send a warmup request with an empty query to update the cache. See \u003chttps://developers.google.com/people/v1/other-contacts#search_the_users_other_contacts\u003e\n\n### HTTP request\n\n`GET https://people.googleapis.com/v1/otherContacts:search`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `query` | `string` Required. The plain-text query for the request. The query is used to match prefix phrases of the fields on a person. For example, a person with name \"foo name\" matches queries such as \"f\", \"fo\", \"foo\", \"foo n\", \"nam\", etc., but not \"oo n\". |\n| `pageSize` | `integer` Optional. The number of results to return. Defaults to 10 if field is not set, or set to 0. Values greater than 30 will be capped to 30. |\n| `readMask` | `string (`[FieldMask](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask)` format)` Required. A field mask to restrict which fields on each person are returned. Multiple fields can be specified by separating them with commas. Valid values are: - emailAddresses - metadata - names - phoneNumbers |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body contains an instance of [SearchResponse](/people/api/rest/v1/SearchResponse).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/contacts.other.readonly`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]