Google Classroom アドオンの一般提供が開始されました。詳しくは、
アドオンのドキュメントをご覧ください。
Method: userProfiles.guardianInvitations.patch
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
保護者の招待状を変更します。
現在、有効な変更は state
を PENDING
から COMPLETE
に変更することのみです。これにより、招待が取り消されます。
このメソッドは、次のエラーコードを返します。
PERMISSION_DENIED
: 現在のユーザーに保護者の管理権限がない、該当するドメインで保護者が有効になっていない場合、またはその他のアクセス エラーの場合。
- 保護者のリンクが
PENDING
状態でない場合は FAILED_PRECONDITION
です。
INVALID_ARGUMENT
: 指定された学生 ID の形式が認識できない場合(メールアドレスでも、この API の userId
でもない)、渡された GuardianInvitation
に COMPLETE
以外の state
が含まれている場合、または state
以外のフィールドが変更されている場合。
NOT_FOUND
: 指定された生徒 ID が有効な生徒 ID であるにもかかわらず、Classroom にその生徒の記録がない場合、または id
フィールドが Classroom に登録されている保護者の招待状を参照していない場合。
HTTP リクエスト
PATCH https://classroom.googleapis.com/v1/userProfiles/{studentId}/guardianInvitations/{invitationId}
この URL は gRPC Transcoding 構文を使用します。
パスパラメータ
パラメータ |
studentId |
string
保護者の招待状を変更する生徒の ID。
|
invitationId |
string
変更する GuardianInvitation の id フィールド。
|
クエリ パラメータ
パラメータ |
updateMask |
string (FieldMask format)
コースのどのフィールドを更新するかを特定するマスク。このフィールドは更新を行うために必須です。無効なフィールドが指定されている場合、更新は失敗します。有効なフィールドは次のとおりです。
クエリ パラメータで設定する場合は、このフィールドを次のように指定する必要があります。 updateMask=<field1>,<field2>,...
完全修飾フィールド名のカンマ区切りリスト。例: "user.displayName,photo" 。
|
リクエストの本文
リクエストの本文には GuardianInvitation
のインスタンスが含まれます。
レスポンスの本文
成功した場合、レスポンスの本文には GuardianInvitation
のインスタンスが含まれます。
認可スコープ
次の OAuth スコープが必要です。
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.guardianInvitations.patch\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- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nModifies a guardian invitation.\n\nCurrently, the only valid modification is to change the `state` from `PENDING` to `COMPLETE`. This has the effect of withdrawing the invitation.\n\nThis method returns the following error codes:\n\n- `PERMISSION_DENIED` if the current user does not have permission to manage guardians, if guardians are not enabled for the domain in question or for other [access errors](/workspace/classroom/reference/Access.Errors).\n- `FAILED_PRECONDITION` if the guardian link is not in the `PENDING` state.\n- `INVALID_ARGUMENT` if the format of the student ID provided cannot be recognized (it is not an email address, nor a `userId` from this API), or if the passed `GuardianInvitation` has a `state` other than `COMPLETE`, or if it modifies fields other than `state`.\n- `NOT_FOUND` if the student ID provided is a valid student ID, but Classroom has no record of that student, or if the `id` field does not refer to a guardian invitation known to Classroom.\n\n### HTTP request\n\n`PATCH https://classroom.googleapis.com/v1/userProfiles/{studentId}/guardianInvitations/{invitationId}`\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 invitation is to be modified. |\n| `invitationId` | `string` The `id` field of the `GuardianInvitation` to be modified. |\n\n### Query parameters\n\n| Parameters ||\n|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `updateMask` | `string (`[FieldMask](https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask)` format)` Mask that identifies which fields on the course to update. This field is required to do an update. The update fails if invalid fields are specified. The following fields are valid: - `state` When set in a query parameter, this field should be specified as `updateMask=\u003cfield1\u003e,\u003cfield2\u003e,...` This is a comma-separated list of fully qualified names of fields. Example: `\"user.displayName,photo\"`. |\n\n### Request body\n\nThe request body contains an instance of [GuardianInvitation](/workspace/classroom/reference/rest/v1/userProfiles.guardianInvitations#GuardianInvitation).\n\n### Response body\n\nIf successful, the response body contains an instance of [GuardianInvitation](/workspace/classroom/reference/rest/v1/userProfiles.guardianInvitations#GuardianInvitation).\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)."]]