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.get
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.
Trả về một người giám hộ cụ thể.
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 xem thông tin người giám hộ của học viên do studentId
xác định, 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, studentId
từ API hay chuỗi ký tự me
).
NOT_FOUND
nếu người dùng yêu cầu được phép xem người giám hộ của studentId
được yêu cầu, nhưng không có bản ghi Guardian
nào cho học viên đó khớp với guardianId
đã cung cấp.
Yêu cầu HTTP
GET 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 mà bạn yêu cầu người giám hộ. 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ẽ chứa một phiên bản của Guardian
.
Phạm vi uỷ quyền
Yêu cầu một trong các phạm vi OAuth sau:
https://www.googleapis.com/auth/classroom.guardianlinks.me.readonly
https://www.googleapis.com/auth/classroom.guardianlinks.students.readonly
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.get\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\nReturns a specific guardian.\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 view guardian information 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, nor the literal string `me`).\n- `NOT_FOUND` if the requesting user is permitted to view guardians for the requested `studentId`, but no `Guardian` record exists for that student that matches the provided `guardianId`.\n\n### HTTP request\n\n`GET 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 being requested. 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 contains an instance of [Guardian](/workspace/classroom/reference/rest/v1/userProfiles.guardians#Guardian).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/classroom.guardianlinks.me.readonly`\n- `\n https://www.googleapis.com/auth/classroom.guardianlinks.students.readonly`\n- `\n https://www.googleapis.com/auth/classroom.guardianlinks.students`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]