ส่วนเสริมของ Google Classroom พร้อมให้บริการแก่นักพัฒนาซอฟต์แวร์แล้ว โปรดดูข้อมูลเพิ่มเติมใน
เอกสารส่วนเสริม
Method: userProfiles.guardianInvitations.patch
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
แก้ไขคำเชิญผู้ปกครอง
ปัจจุบันการแก้ไขที่ถูกต้องเพียงอย่างเดียวคือการเปลี่ยน state
จาก PENDING
เป็น COMPLETE
ซึ่งจะส่งผลเป็นการถอนคำเชิญ
วิธีการนี้จะแสดงรหัสข้อผิดพลาดต่อไปนี้
PERMISSION_DENIED
หากผู้ใช้ปัจจุบันไม่มีสิทธิ์จัดการผู้ปกครอง หากไม่ได้เปิดใช้ผู้ปกครองสําหรับโดเมนที่เป็นปัญหา หรือหากเกิดข้อผิดพลาดในการเข้าถึงอื่นๆ
FAILED_PRECONDITION
หากลิงก์ของผู้ปกครองไม่ได้อยู่ในสถานะ PENDING
INVALID_ARGUMENT
หากระบบไม่รู้จักรูปแบบบัตรประจำตัวนักเรียนที่ระบุ (ไม่ใช่อีเมลหรือ userId
จาก API นี้) หรือหาก GuardianInvitation
ที่ส่งมี state
อื่นที่ไม่ใช่ COMPLETE
หรือหากมีการแก้ไขช่องอื่นที่ไม่ใช่ state
NOT_FOUND
หากรหัสนักศึกษาที่ระบุเป็นรหัสนักศึกษาที่ถูกต้อง แต่ Classroom ไม่มีบันทึกของนักเรียนคนดังกล่าว หรือหากช่อง id
ไม่ได้อ้างอิงคำเชิญผู้ปกครองที่ Classroom รู้จัก
คำขอ HTTP
PATCH https://classroom.googleapis.com/v1/userProfiles/{studentId}/guardianInvitations/{invitationId}
URL ใช้ไวยากรณ์การแปลง gRPC
พารามิเตอร์เส้นทาง
พารามิเตอร์ |
studentId |
string
รหัสของนักเรียนที่จะแก้ไขคำเชิญผู้ปกครอง
|
invitationId |
string
ช่อง id ของ GuardianInvitation ที่จะแก้ไข
|
พารามิเตอร์การค้นหา
พารามิเตอร์ |
updateMask |
string (FieldMask format)
หน้ากากที่ระบุฟิลด์ในหลักสูตรที่จะอัปเดต ต้องกรอกข้อมูลในช่องนี้เพื่ออัปเดต การอัปเดตจะดำเนินการไม่สำเร็จหากระบุช่องที่ไม่ถูกต้อง ฟิลด์ต่อไปนี้ใช้ได้
เมื่อตั้งค่าในพารามิเตอร์การค้นหา คุณควรระบุช่องนี้เป็น updateMask=<field1>,<field2>,...
ซึ่งเป็นรายการชื่อฟิลด์ที่สมบูรณ์ในตัวเองที่คั่นด้วยคอมมา ตัวอย่าง: "user.displayName,photo"
|
เนื้อความของคำขอ
เนื้อความของคำขอมีอินสแตนซ์ของ GuardianInvitation
เนื้อหาการตอบกลับ
หากทำสำเร็จ เนื้อหาการตอบกลับจะมีอินสแตนซ์ GuardianInvitation
ขอบเขตการให้สิทธิ์
ต้องใช้ขอบเขต OAuth ต่อไปนี้
https://www.googleapis.com/auth/classroom.guardianlinks.students
ดูข้อมูลเพิ่มเติมได้ที่คู่มือการให้สิทธิ์
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[],[],null,["# Method: userProfiles.guardianInvitations.patch\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\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\nModifies a guardian invitation.\n\nCurrently, the only valid modification is to change the `state` from `PENDING` to `COMPLETE`. This has the effect of withdrawing the invitation.\n\nThis method returns the following error codes:\n\n- `PERMISSION_DENIED` if the current user does not have permission to manage guardians, if guardians are not enabled for the domain in question or for other [access errors](/workspace/classroom/reference/Access.Errors).\n- `FAILED_PRECONDITION` if the guardian link is not in the `PENDING` state.\n- `INVALID_ARGUMENT` if the format of the student ID provided cannot be recognized (it is not an email address, nor a `userId` from this API), or if the passed `GuardianInvitation` has a `state` other than `COMPLETE`, or if it modifies fields other than `state`.\n- `NOT_FOUND` if the student ID provided is a valid student ID, but Classroom has no record of that student, or if the `id` field does not refer to a guardian invitation known to Classroom.\n\n### HTTP request\n\n`PATCH https://classroom.googleapis.com/v1/userProfiles/{studentId}/guardianInvitations/{invitationId}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------------|-----------------------------------------------------------------------------|\n| `studentId` | `string` The ID of the student whose guardian invitation is to be modified. |\n| `invitationId` | `string` The `id` field of the `GuardianInvitation` to be modified. |\n\n### Query parameters\n\n| Parameters ||\n|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `updateMask` | `string (`[FieldMask](https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask)` format)` Mask that identifies which fields on the course to update. This field is required to do an update. The update fails if invalid fields are specified. The following fields are valid: - `state` When set in a query parameter, this field should be specified as `updateMask=\u003cfield1\u003e,\u003cfield2\u003e,...` This is a comma-separated list of fully qualified names of fields. Example: `\"user.displayName,photo\"`. |\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 an 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)."]]