Method: otherContacts.copyOtherContactToMyContactsGroup
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-08-21。
[null,null,["最后更新时间 (UTC):2024-08-21。"],[[["\u003cp\u003eCopies an "Other contact" to the user's "myContacts" group, allowing you to easily manage and organize your contacts.\u003c/p\u003e\n"],["\u003cp\u003eThe API request requires specifying the resource name of the "Other contact" and allows for optional control over fields to be copied and returned using field masks.\u003c/p\u003e\n"],["\u003cp\u003eYou can specify which data sources to consider for the copy operation, and the response includes the newly created "myContacts" person object.\u003c/p\u003e\n"],["\u003cp\u003eRequires authorization with specific OAuth scopes related to contact management.\u003c/p\u003e\n"],["\u003cp\u003eFor optimal performance, ensure sequential requests for the same user to avoid latency or failures.\u003c/p\u003e\n"]]],["This describes copying an \"Other contact\" to a user's \"myContacts\" group using a `POST` request to `https://people.googleapis.com/v1/{resourceName=otherContacts/*}:copyOtherContactToMyContactsGroup`. The `resourceName` path parameter specifies the \"Other contact\" to copy. The request body requires a `copyMask` to specify fields to copy, and optionally `readMask` and `sources`. Successful requests return a `Person` instance. Mutate requests for the same user should be sequential. Authorization requires specific OAuth scopes.\n"],null,["# Method: otherContacts.copyOtherContactToMyContactsGroup\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nCopies an \"Other contact\" to a new contact in the user's \"myContacts\" group\n\nMutate requests for the same user should be sent sequentially to avoid increased latency and failures.\n\n### HTTP request\n\n`POST https://people.googleapis.com/v1/{resourceName=otherContacts/*}:copyOtherContactToMyContactsGroup`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------------|----------------------------------------------------------------------|\n| `resourceName` | `string` Required. The resource name of the \"Other contact\" to copy. |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|--------------------------------------------------------------------------------------------------------------|\n| ``` { \"copyMask\": string, \"readMask\": string, \"sources\": [ enum (/people/api/rest/v1/ReadSourceType) ] } ``` |\n\n| Fields ||\n|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `copyMask` | `string (`[FieldMask](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask)` format)` Required. A field mask to restrict which fields are copied into the new contact. Valid values are: - emailAddresses - names - phoneNumbers |\n| `readMask` | `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 person are returned. Multiple fields can be specified by separating them with commas. Defaults to the copy mask with metadata and membership fields if not set. Valid values are: - addresses - ageRanges - biographies - birthdays - calendarUrls - clientData - coverPhotos - emailAddresses - events - externalIds - genders - imClients - interests - locales - locations - memberships - metadata - miscKeywords - names - nicknames - occupations - organizations - phoneNumbers - photos - relations - sipAddresses - skills - urls - userDefined |\n| `sources[]` | `enum (`[ReadSourceType](/people/api/rest/v1/ReadSourceType)`)` Optional. A mask of what source types to return. Defaults to [READ_SOURCE_TYPE_CONTACT](/people/api/rest/v1/ReadSourceType#ENUM_VALUES.READ_SOURCE_TYPE_CONTACT) and [READ_SOURCE_TYPE_PROFILE](/people/api/rest/v1/ReadSourceType#ENUM_VALUES.READ_SOURCE_TYPE_PROFILE) if not set. |\n\n### Response body\n\nIf successful, the response body contains an instance of [Person](/people/api/rest/v1/people#Person).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/contacts.other.readonly`\n- `https://www.googleapis.com/auth/contacts`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]