INVALID_ARGUMENT:如果監護人電子郵件地址無效 (例如過長),或是系統無法辨識學生 ID 的格式 (非電子郵件地址,也不是這個 API 的 userId),則為 INVALID_ARGUMENT。如果設定了唯讀欄位,或 state 欄位設為 PENDING 以外的值,系統也會傳回這個錯誤。
如果提供的學生 ID 是有效的學生 ID,但 Classroom 沒有該學生的記錄,則為 NOT_FOUND。
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"]],["上次更新時間:2024-09-04 (世界標準時間)。"],[[["Creates a guardian invitation and sends an email to the invited email address for confirmation to become a student's guardian."],["Requires the `studentId` and `invitedEmailAddress` in the request body to create the invitation."],["Returns a `GuardianInvitation` object upon successful creation, containing the invitation details."],["Several error codes are possible, such as `PERMISSION_DENIED`, `RESOURCE_EXHAUSTED`, `INVALID_ARGUMENT`, `NOT_FOUND`, and `ALREADY_EXISTS`, indicating various issues with the request or student/guardian status."],["Utilizes the `https://www.googleapis.com/auth/classroom.guardianlinks.students` OAuth scope for authorization."]]],[]]