Method: contactGroups.create
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2024-08-21(UTC)
[null,null,["최종 업데이트: 2024-08-21(UTC)"],[[["\u003cp\u003eCreate new contact groups owned by the authenticated user with unique names.\u003c/p\u003e\n"],["\u003cp\u003eDuplicate contact group names will result in an HTTP 409 error.\u003c/p\u003e\n"],["\u003cp\u003eSequential mutate requests from the same user are recommended to minimize latency and failures.\u003c/p\u003e\n"],["\u003cp\u003eThis operation requires the \u003ccode\u003ehttps://www.googleapis.com/auth/contacts\u003c/code\u003e OAuth scope.\u003c/p\u003e\n"]]],["This documentation outlines how to create a new contact group via the Google People API. A `POST` request to `https://people.googleapis.com/v1/contactGroups` is required, with a JSON request body that defines the `contactGroup` object and optional `readGroupFields`. Group names must be unique per user, and duplicate names return a 409 error. The successful response returns the newly created `ContactGroup` and needs to be done with `https://www.googleapis.com/auth/contacts` scope. Mutate requests must be sent sequentially.\n"],null,["# Method: contactGroups.create\n\n- [HTTP request](#body.HTTP_TEMPLATE)\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\nCreate a new contact group owned by the authenticated user.\n\nCreated contact group names must be unique to the users contact groups. Attempting to create a group with a duplicate name will return a HTTP 409 error.\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/contactGroups`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|--------------------------------------------------------------------------------------------------------------------|\n| ``` { \"contactGroup\": { object (/people/api/rest/v1/contactGroups#ContactGroup) }, \"readGroupFields\": string } ``` |\n\n| Fields ||\n|-------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `contactGroup` | `object (`[ContactGroup](/people/api/rest/v1/contactGroups#ContactGroup)`)` Required. The contact group to create. |\n| `readGroupFields` | `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`, and `name` if not set or set to empty. Valid fields are: - clientData - groupType - metadata - name |\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [ContactGroup](/people/api/rest/v1/contactGroups#ContactGroup).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/contacts`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]