Google Classroom 外掛程式現已全面開放開發人員使用!詳情請參閱
外掛程式說明文件。
Method: userProfiles.guardians.list
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
傳回要求使用者可查看的監護人清單,且僅限於符合要求的監護人。
如要列出要求使用者可查看監護人的任何學生的監護人資訊,請使用文字符號 -
做為學生 ID。
這個方法會傳回下列錯誤代碼:
PERMISSION_DENIED
如果已指定 studentId
,且要求使用者無法查看該學生的監護人資訊;如果 "-"
已指定為 studentId
,且使用者不是網域管理員;如果問題網域未啟用監護人功能;如果 invitedEmailAddress
篩選器是由非網域管理員的使用者設定;或其他存取錯誤。
INVALID_ARGUMENT
:如果指定 studentId
,但系統無法辨識格式 (不是電子郵件地址、API 中的 studentId
,也非文字常值字串 me
)。如果提供無效的 pageToken
,系統也可能會傳回此值。
NOT_FOUND
指定 studentId
且系統可辨識其格式,但 Classroom 沒有該學生的記錄。
HTTP 要求
GET https://classroom.googleapis.com/v1/userProfiles/{studentId}/guardians
這個網址使用 gRPC 轉碼語法。
路徑參數
參數 |
studentId |
string
根據監護人連結的學生篩選結果。識別碼可以是下列任一項:
- 使用者的數字 ID
- 使用者的電子郵件地址
- 字串常值
"me" ,表示要求使用者
- 字串文字
"-" ,表示應針對要求使用者有權查看的所有學生傳回結果。
|
查詢參數
參數 |
invitedEmailAddress |
string
根據原始邀請函寄送的電子郵件地址篩選結果,即可取得這個監護人連結。只有網域管理員可以使用這個篩選器。
|
pageToken |
string
先前 list 呼叫傳回的 nextPageToken 值,表示應傳回後續的結果頁面。 list 要求必須與產生此權杖的要求完全相同。
|
pageSize |
integer
傳回的項目數量上限。零或未指定的值表示伺服器可能會指派最大值。 伺服器傳回的結果數量可能少於指定數量。
|
回應主體
列出監護人的回應。
如果成功,回應主體會含有以下結構的資料:
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
詳情請參閱授權指南。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[],[],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)."]]