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.guardians.delete
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.
Xoá người giám hộ.
Người giám hộ sẽ không còn nhận được thông báo dành cho người giám hộ và không thể truy cập được người giám hộ thông qua API nữa.
Phương thức này trả về các mã lỗi sau:
PERMISSION_DENIED
nếu người dùng yêu cầu không thấy người dùng nào khớp với studentId
đã cung cấp, nếu người dùng yêu cầu không được phép quản lý người giám hộ cho học viên được xác định bằng studentId
, nếu người giám hộ không được bật cho miền có liên quan hoặc đối với các lỗi truy cập khác.
INVALID_ARGUMENT
nếu bạn chỉ định studentId
nhưng không nhận dạng được định dạng của studentId
(đây không phải là địa chỉ email cũng không phải là studentId
từ API).
NOT_FOUND
nếu người dùng yêu cầu được phép sửa đổi người giám hộ cho studentId
đã yêu cầu, nhưng không có bản ghi Guardian
nào tồn tại cho học viên đó với guardianId
đã cung cấp.
Yêu cầu HTTP
DELETE https://classroom.googleapis.com/v1/userProfiles/{studentId}/guardians/{guardianId}
URL sử dụng cú pháp Chuyển mã gRPC.
Tham số đường dẫn
Thông số |
studentId |
string
Học viên có người giám hộ cần xoá. Một trong số sau:
- giá trị nhận dạng dạng số của người dùng
- địa chỉ email của người dùng
- chuỗi cố định
"me" , cho biết người dùng yêu cầu
|
guardianId |
string
Trường id từ Guardian .
|
Nội dung yêu cầu
Nội dung yêu cầu phải trống.
Nội dung phản hồi
Nếu thành công, nội dung phản hồi sẽ là một đối tượng JSON trống.
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.guardians.delete\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\nDeletes a guardian.\n\nThe guardian will no longer receive guardian notifications and the guardian will no longer be accessible via the API.\n\nThis method returns the following error codes:\n\n- `PERMISSION_DENIED` if no user that matches the provided `studentId` is visible to the requesting user, if the requesting user is not permitted to manage guardians for the student identified by the `studentId`, if guardians are not enabled for the domain in question, or for other [access errors](/workspace/classroom/reference/Access.Errors).\n- `INVALID_ARGUMENT` if a `studentId` is specified, but its format cannot be recognized (it is not an email address, nor a `studentId` from the API).\n- `NOT_FOUND` if the requesting user is permitted to modify guardians for the requested `studentId`, but no `Guardian` record exists for that student with the provided `guardianId`.\n\n### HTTP request\n\n`DELETE https://classroom.googleapis.com/v1/userProfiles/{studentId}/guardians/{guardianId}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `studentId` | `string` The student whose guardian is to be deleted. One of the following: - the numeric identifier for the user - the email address of the user - the string literal `\"me\"`, indicating the requesting user |\n| `guardianId` | `string` The `id` field from a `Guardian`. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body is an empty JSON object.\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)."]]