요청 객체에 studentId 및 invitedEmailAddress 필드가 설정되어 있어야 합니다. 이러한 필드를 설정하지 않거나 요청에 다른 필드를 설정하면 오류가 발생합니다.
이 메서드는 다음 오류 코드를 반환합니다.
PERMISSION_DENIED: 현재 사용자에게 보호자를 관리할 권한이 없거나, 해당 보호자가 해당 학생에 대한 요청을 이미 너무 많이 거부했거나, 해당 도메인에 보호자가 사용 설정되어 있지 않거나, 기타 액세스 오류가 있는 경우
RESOURCE_EXHAUSTED: 학생 또는 보호자가 보호자 링크 한도를 초과한 경우
보호자 이메일 주소가 유효하지 않거나 (예: 너무 긴 경우) 제공된 학생 ID 형식을 인식할 수 없는 경우 (이메일 주소가 아니거나 이 API의 userId가 아닌 경우) INVALID_ARGUMENT 읽기 전용 필드가 설정되거나 state 필드가 PENDING이 아닌 값으로 설정된 경우에도 이 오류가 반환됩니다.
NOT_FOUND: 제공된 학생 ID가 유효한 학생 ID이지만 클래스룸에 해당 학생의 기록이 없는 경우
ALREADY_EXISTS: 학생에 대한 보호자 초대가 이미 대기 중이고 제공된 invitedEmailAddress가 있거나 제공된 invitedEmailAddress가 이 사용자의 기존 Guardian의 Google 계정과 일치하는 경우
HTTP 요청
POST https://classroom.googleapis.com/v1/userProfiles/{guardianInvitation.studentId}/guardianInvitations
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-25(UTC)"],[],[],null,["# Method: userProfiles.guardianInvitations.create\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nCreates a guardian invitation, and sends an email to the guardian asking them to confirm that they are the student's guardian.\n\nOnce the guardian accepts the invitation, their `state` will change to `COMPLETED` and they will start receiving guardian notifications. A `Guardian` resource will also be created to represent the active guardian.\n\nThe request object must have the `studentId` and `invitedEmailAddress` fields set. Failing to set these fields, or setting any other fields in the request, will result in an error.\n\nThis method returns the following error codes:\n\n- `PERMISSION_DENIED` if the current user does not have permission to manage guardians, if the guardian in question has already rejected too many requests for that student, if guardians are not enabled for the domain in question, or for other [access errors](/workspace/classroom/reference/Access.Errors).\n- `RESOURCE_EXHAUSTED` if the student or guardian has exceeded the guardian link limit.\n- `INVALID_ARGUMENT` if the guardian email address is not valid (for example, if it is too long), or if the format of the student ID provided cannot be recognized (it is not an email address, nor a `userId` from this API). This error will also be returned if read-only fields are set, or if the `state` field is set to to a value other than `PENDING`.\n- `NOT_FOUND` if the student ID provided is a valid student ID, but Classroom has no record of that student.\n- `ALREADY_EXISTS` if there is already a pending guardian invitation for the student and `invitedEmailAddress` provided, or if the provided `invitedEmailAddress` matches the Google account of an existing `Guardian` for this user.\n\n### HTTP request\n\n`POST https://classroom.googleapis.com/v1/userProfiles/{guardianInvitation.studentId}/guardianInvitations`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|--------------------------------|-------------------------------------------------|\n| `guardianInvitation.studentId` | `string` ID of the student (in standard format) |\n\n### Request body\n\nThe request body contains an instance of [GuardianInvitation](/workspace/classroom/reference/rest/v1/userProfiles.guardianInvitations#GuardianInvitation).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [GuardianInvitation](/workspace/classroom/reference/rest/v1/userProfiles.guardianInvitations#GuardianInvitation).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/classroom.guardianlinks.students`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]