Google Classroom 外掛程式現已全面開放開發人員使用!詳情請參閱
外掛程式說明文件。
Method: userProfiles.guardianInvitations.list
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
傳回要求使用者可查看的監護人邀請清單,並根據提供的參數進行篩選。
這個方法會傳回下列錯誤代碼:
PERMISSION_DENIED
如果已指定 studentId
,且要求使用者無法查看該學生的監護人邀請;如果 "-"
已指定為 studentId
,且使用者不是網域管理員;如果問題網域未啟用監護人功能;或發生其他存取錯誤。
INVALID_ARGUMENT
:如果指定 studentId
,但系統無法辨識其格式 (不是電子郵件地址、不是 API 中的 studentId
,也不是文字常值字串 me
)。如果提供無效的 pageToken
或 state
,系統也可能會傳回此錯誤。
NOT_FOUND
指定 studentId
且系統可辨識其格式,但 Classroom 沒有該學生的記錄。
HTTP 要求
GET https://classroom.googleapis.com/v1/userProfiles/{studentId}/guardianInvitations
這個網址使用 gRPC 轉碼語法。
路徑參數
參數 |
studentId |
string
要傳回監護人邀請的學生 ID。識別碼可以是下列任一項:
- 使用者的數字 ID
- 使用者的電子郵件地址
- 字串常值
"me" ,表示要求使用者
- 字串文字
"-" ,表示應針對要求使用者可查看家長邀請的所有學生傳回結果。
|
查詢參數
參數 |
invitedEmailAddress |
string
如果指定了 invitedEmailAddress ,系統只會傳回含有指定 invitedEmailAddress 的結果。
|
states[] |
enum (GuardianInvitationState )
如果指定了 state 值,系統只會傳回含有指定 state 值的結果。否則,系統會傳回 state 為 PENDING 的結果。
|
pageToken |
string
先前 list 呼叫傳回的 nextPageToken 值,表示應傳回後續的結果頁面。 list 要求必須與產生此權杖的要求完全相同。
|
pageSize |
integer
傳回的項目數量上限。零或未指定的值表示伺服器可能會指派最大值。 伺服器傳回的結果數量可能少於指定數量。
|
回應主體
列出監護人邀請時的回應。
如果成功,回應主體會含有以下結構的資料:
JSON 表示法 |
{
"guardianInvitations": [
{
object (GuardianInvitation )
}
],
"nextPageToken": string
} |
欄位 |
guardianInvitations[] |
object (GuardianInvitation )
符合清單要求的監護人邀請。
|
nextPageToken |
string
用於識別要傳回的下一頁結果的符記。如果留空,表示沒有其他結果。
|
授權範圍
需要下列其中一種 OAuth 範圍:
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.guardianInvitations.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.ListGuardianInvitationsResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nReturns a list of guardian invitations that the requesting user is permitted to view, filtered by the parameters provided.\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 invitations 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, 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` or `state` 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}/guardianInvitations`\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 invitations are to be returned. 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 is permitted to view guardian invitations. |\n\n### Query parameters\n\n| Parameters ||\n|-----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `invitedEmailAddress` | `string` If specified, only results with the specified `invitedEmailAddress` are returned. |\n| `states[]` | `enum (`[GuardianInvitationState](/workspace/classroom/reference/rest/v1/userProfiles.guardianInvitations#GuardianInvitationState)`)` If specified, only results with the specified `state` values are returned. Otherwise, results with a `state` of `PENDING` are returned. |\n| `pageToken` | `string` [nextPageToken](/workspace/classroom/reference/rest/v1/userProfiles.guardianInvitations/list#body.ListGuardianInvitationsResponse.FIELDS.next_page_token) value returned from a previous [list](/workspace/classroom/reference/rest/v1/userProfiles.guardianInvitations/list#google.classroom.v1.GuardianInvitations.ListGuardianInvitations) call, indicating that the subsequent page of results should be returned. The [list](/workspace/classroom/reference/rest/v1/userProfiles.guardianInvitations/list#google.classroom.v1.GuardianInvitations.ListGuardianInvitations) 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 guardian invitations.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"guardianInvitations\": [ { object (/workspace/classroom/reference/rest/v1/userProfiles.guardianInvitations#GuardianInvitation) } ], \"nextPageToken\": string } ``` |\n\n| Fields ||\n|-------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `guardianInvitations[]` | `object (`[GuardianInvitation](/workspace/classroom/reference/rest/v1/userProfiles.guardianInvitations#GuardianInvitation)`)` Guardian invitations that matched the list 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.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)."]]