Hiện tại, các nhà phát triển đã có thể sử dụng rộng rãi tiện ích bổ sung của Google Lớp học! Vui lòng xem
tài liệu về tiện ích bổ sung để biết thêm thông tin.
Method: userProfiles.guardianInvitations.patch
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Sửa đổi lời mời dành cho người giám hộ.
Hiện tại, nội dung sửa đổi hợp lệ duy nhất là thay đổi state
từ PENDING
thành COMPLETE
. Thao tác này sẽ có hiệu lực rút lại lời mời.
Phương thức này trả về các mã lỗi sau:
PERMISSION_DENIED
nếu người dùng hiện tại không có quyền quản lý người giám hộ, nếu người giám hộ không được bật cho miền có liên quan hoặc nếu có lỗi truy cập khác.
FAILED_PRECONDITION
nếu đường liên kết của người giám hộ không ở trạng thái PENDING
.
INVALID_ARGUMENT
nếu không thể nhận dạng định dạng của thẻ sinh viên được cung cấp (định dạng này không phải là địa chỉ email, cũng không phải là userId
từ API này) hoặc nếu GuardianInvitation
đã truyền có state
khác với COMPLETE
hoặc nếu GuardianInvitation
sửa đổi các trường khác với state
.
NOT_FOUND
nếu mã học viên được cung cấp là mã học viên hợp lệ nhưng Lớp học không có hồ sơ về học viên đó hoặc nếu trường id
không đề cập đến lời mời của người giám hộ mà Lớp học biết.
Yêu cầu HTTP
PATCH https://classroom.googleapis.com/v1/userProfiles/{studentId}/guardianInvitations/{invitationId}
URL sử dụng cú pháp Chuyển mã gRPC.
Tham số đường dẫn
Thông số |
studentId |
string
Giấy tờ tuỳ thân của học viên mà bạn muốn sửa đổi lời mời dành cho người giám hộ.
|
invitationId |
string
Trường id của GuardianInvitation cần được sửa đổi.
|
Tham số truy vấn
Thông số |
updateMask |
string (FieldMask format)
Mặt nạ xác định những trường trên khoá học cần cập nhật. Đây là trường bắt buộc để cập nhật. Quá trình cập nhật sẽ không thành công nếu bạn chỉ định các trường không hợp lệ. Các trường sau đây là hợp lệ:
Khi được đặt trong tham số truy vấn, trường này phải được chỉ định là updateMask=<field1>,<field2>,...
Đây là danh sách tên trường đủ điều kiện được phân tách bằng dấu phẩy. Ví dụ: "user.displayName,photo"
|
Nội dung yêu cầu
Nội dung yêu cầu chứa một bản sao của GuardianInvitation
.
Nội dung phản hồi
Nếu thành công, nội dung phản hồi sẽ chứa một phiên bản của GuardianInvitation
.
Phạm vi uỷ quyền
Yêu cầu phạm vi OAuth sau:
https://www.googleapis.com/auth/classroom.guardianlinks.students
Để biết thêm thông tin, hãy xem Hướng dẫn uỷ quyền.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 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)."]]