ส่วนเสริมของ Google Classroom พร้อมให้บริการแก่นักพัฒนาซอฟต์แวร์แล้ว โปรดดูข้อมูลเพิ่มเติมใน
เอกสารส่วนเสริม
Method: userProfiles.guardians.list
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
แสดงรายการผู้ปกครองที่ผู้ใช้ที่ส่งคำขอได้รับอนุญาตให้ดู โดยจำกัดไว้เฉพาะผู้ปกครองที่ตรงกับคำขอ
หากต้องการแสดงรายการผู้ปกครองของนักเรียนที่ผู้ใช้ที่ขอดูได้ ให้ใช้อักขระ -
สำหรับรหัสนักเรียน
วิธีการนี้จะแสดงรหัสข้อผิดพลาดต่อไปนี้
PERMISSION_DENIED
หากระบุ studentId
และผู้ใช้ที่ขอไม่ได้รับอนุญาตให้ดูข้อมูลผู้ปกครองของนักเรียนรายนั้น หากระบุ "-"
เป็น studentId
และผู้ใช้ไม่ใช่ผู้ดูแลระบบโดเมน หากไม่ได้เปิดใช้ผู้ปกครองสําหรับโดเมนที่เป็นปัญหา หากผู้ใช้ที่ไม่ใช่ผู้ดูแลระบบโดเมนเป็นผู้ตั้งค่าตัวกรอง invitedEmailAddress
หรือสําหรับข้อผิดพลาดในการเข้าถึงอื่นๆ
INVALID_ARGUMENT
หากระบุ studentId
แต่ระบบไม่รู้จักรูปแบบ (ไม่ใช่อีเมล ไม่ใช่ studentId
จาก API และไม่ใช่สตริงตามตัวอักษร me
) ระบบอาจแสดงผล INVALID_ARGUMENT
ด้วยหากระบุ pageToken
ที่ไม่ถูกต้อง
NOT_FOUND
หากระบุ studentId
และระบบจดจำรูปแบบได้ แต่ Classroom ไม่มีบันทึกของนักเรียนคนนั้น
คำขอ HTTP
GET https://classroom.googleapis.com/v1/userProfiles/{studentId}/guardians
URL ใช้ไวยากรณ์การแปลง gRPC
พารามิเตอร์เส้นทาง
พารามิเตอร์ |
studentId |
string
กรองผลลัพธ์ตามนักเรียนที่ผู้ปกครองลิงก์ไว้ ตัวระบุอาจเป็นค่าใดค่าหนึ่งต่อไปนี้
- ตัวระบุตัวเลขของผู้ใช้
- อีเมลของผู้ใช้
- สตริงตามตัวอักษร
"me" ที่ระบุผู้ใช้ที่ส่งคำขอ
- สตริงลิเทอรัล
"-" ซึ่งระบุว่าควรแสดงผลลัพธ์สำหรับนักเรียนทุกคนที่ผู้ใช้ที่ส่งคำขอมีสิทธิ์ดู
|
พารามิเตอร์การค้นหา
พารามิเตอร์ |
invitedEmailAddress |
string
กรองผลลัพธ์ตามอีเมลที่ส่งคำเชิญฉบับแรกไปให้ ซึ่งทำให้เกิดลิงก์ของผู้ปกครองนี้ มีเพียงผู้ดูแลระบบโดเมนเท่านั้นที่ใช้ตัวกรองนี้ได้
|
pageToken |
string
ค่า nextPageToken ที่แสดงผลจากการเรียก list ก่อนหน้า ซึ่งระบุว่าควรแสดงผลหน้าผลการค้นหาถัดไป คําขอ list ต้องเหมือนกับคําขอที่ทําให้เกิดโทเค็นนี้
|
pageSize |
integer
จำนวนรายการสูงสุดที่จะแสดง 0 หรือไม่ระบุหมายความว่าเซิร์ฟเวอร์อาจกำหนดค่าสูงสุด เซิร์ฟเวอร์อาจแสดงผลลัพธ์น้อยกว่าจำนวนที่ระบุ
|
เนื้อความของคำขอ
เนื้อหาของคำขอต้องว่างเปล่า
เนื้อหาการตอบกลับ
การตอบสนองเมื่อระบุผู้ปกครอง
หากทำสำเร็จ เนื้อหาการตอบกลับจะมีข้อมูลซึ่งมีโครงสร้างดังต่อไปนี้
การแสดง JSON |
{
"guardians": [
{
object (Guardian )
}
],
"nextPageToken": string
} |
ช่อง |
guardians[] |
object (Guardian )
ผู้พิทักษ์ในหน้าผลการค้นหานี้ซึ่งเป็นไปตามเกณฑ์ที่ระบุในคำขอ
|
nextPageToken |
string
โทเค็นที่ระบุหน้าถัดไปของผลการค้นหาที่จะแสดง หากช่องนี้ว่างเปล่า แสดงว่าไม่มีผลการค้นหาเพิ่มเติม
|
ขอบเขตการให้สิทธิ์
ต้องใช้ขอบเขต OAuth ต่อไปนี้
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
ดูข้อมูลเพิ่มเติมได้ที่คู่มือการให้สิทธิ์
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[],[],null,["# Method: userProfiles.guardians.list\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 - [JSON representation](#body.ListGuardiansResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nReturns a list of guardians that the requesting user is permitted to view, restricted to those that match the request.\n\nTo list guardians for any student that the requesting user may view guardians for, use the literal character `-` for the student ID.\n\nThis method returns the following error codes:\n\n- `PERMISSION_DENIED` if a `studentId` is specified, and the requesting user is not permitted to view guardian information for that student, if `\"-\"` is specified as the `studentId` and the user is not a domain administrator, if guardians are not enabled for the domain in question, if the `invitedEmailAddress` filter is set by a user who is not a domain administrator, 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`). May also be returned if an invalid `pageToken` is provided.\n- `NOT_FOUND` if a `studentId` is specified, and its format can be recognized, but Classroom has no record of that student.\n\n### HTTP request\n\n`GET https://classroom.googleapis.com/v1/userProfiles/{studentId}/guardians`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|-------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `studentId` | `string` Filter results by the student who the guardian is linked to. The identifier can be one of the following: - the numeric identifier for the user - the email address of the user - the string literal `\"me\"`, indicating the requesting user - the string literal `\"-\"`, indicating that results should be returned for all students that the requesting user has access to view. |\n\n### Query parameters\n\n| Parameters ||\n|-----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `invitedEmailAddress` | `string` Filter results by the email address that the original invitation was sent to, resulting in this guardian link. This filter can only be used by domain administrators. |\n| `pageToken` | `string` [nextPageToken](/workspace/classroom/reference/rest/v1/userProfiles.guardians/list#body.ListGuardiansResponse.FIELDS.next_page_token) value returned from a previous [list](/workspace/classroom/reference/rest/v1/userProfiles.guardians/list#google.classroom.v1.Guardians.ListGuardians) call, indicating that the subsequent page of results should be returned. The [list](/workspace/classroom/reference/rest/v1/userProfiles.guardians/list#google.classroom.v1.Guardians.ListGuardians) request must be otherwise identical to the one that resulted in this token. |\n| `pageSize` | `integer` Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nResponse when listing guardians.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"guardians\": [ { object (/workspace/classroom/reference/rest/v1/userProfiles.guardians#Guardian) } ], \"nextPageToken\": string } ``` |\n\n| Fields ||\n|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `guardians[]` | `object (`[Guardian](/workspace/classroom/reference/rest/v1/userProfiles.guardians#Guardian)`)` Guardians on this page of results that met the criteria specified in the request. |\n| `nextPageToken` | `string` Token identifying the next page of results to return. If empty, no further results are available. |\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)."]]