Dodatki do Google Classroom są teraz ogólnie dostępne dla programistów. Więcej informacji znajdziesz w
dokumentacji dodatków.
Method: userProfiles.guardianInvitations.patch
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Modyfikuje zaproszenie do opiekuna.
Obecnie jedyną możliwą modyfikacją jest zmiana wartości parametru state
z PENDING
na COMPLETE
. W efekcie spowoduje to wycofanie zaproszenia.
Ta metoda zwraca te kody błędów:
PERMISSION_DENIED
, jeśli bieżący użytkownik nie ma uprawnień do zarządzania opiekunami, jeśli opiekunowie nie są włączeni w danej domenie lub z powodu innych błędów dostępu.
FAILED_PRECONDITION
, jeśli link opiekuna nie jest w stanie PENDING
.
INVALID_ARGUMENT
, jeśli nie można rozpoznać formatu podanego identyfikatora ucznia (nie jest to adres e-mail ani identyfikator userId
z tego interfejsu API), jeśli przekazany identyfikator GuardianInvitation
ma wartość state
inną niż COMPLETE
lub jeśli modyfikuje pola inne niż state
.
NOT_FOUND
jeśli podany identyfikator ucznia jest prawidłowy, ale Classroom nie ma informacji o tym uczniu, lub jeśli pole id
nie odnosi się do zaproszenia opiekuna znanego w Classroom.
Żądanie HTTP
PATCH https://classroom.googleapis.com/v1/userProfiles/{studentId}/guardianInvitations/{invitationId}
Adres URL używa składni transkodowania gRPC.
Parametry ścieżki
Parametry |
studentId |
string
Identyfikator ucznia, którego zaproszenie do opiekuna ma zostać zmienione.
|
invitationId |
string
Pole id obiektu GuardianInvitation , które ma zostać zmodyfikowane.
|
Parametry zapytania
Parametry |
updateMask |
string (FieldMask format)
Maska określająca, które pola kursu mają zostać zaktualizowane. To pole jest wymagane do wprowadzenia aktualizacji. Jeśli podasz nieprawidłowe pola, aktualizacja się nie powiedzie. Te pola są prawidłowe:
Gdy to pole jest ustawione w parametrze zapytania, powinno być określone jako updateMask=<field1>,<field2>,...
Jest to lista pełnych nazw pól rozdzielona przecinkami. Przykład: "user.displayName,photo" .
|
Treść żądania
Treść żądania zawiera wystąpienie elementu GuardianInvitation
.
Treść odpowiedzi
W przypadku powodzenia treść odpowiedzi obejmuje wystąpienie elementu GuardianInvitation
.
Zakresy autoryzacji
Wymaga następującego zakresu OAuth:
https://www.googleapis.com/auth/classroom.guardianlinks.students
Więcej informacji znajdziesz w przewodniku dotyczącym autoryzacji.
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-25 UTC.
[null,null,["Ostatnia aktualizacja: 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)."]]