Dodatki do Google Classroom są teraz ogólnie dostępne dla programistów. Więcej informacji znajdziesz w
dokumentacji dodatków.
REST Resource: invitations
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Zasób: Zaproszenie
zaproszenie do dołączenia do zajęć,
Zapis JSON |
{
"id": string,
"userId": string,
"courseId": string,
"role": enum (CourseRole )
} |
Pola |
id |
string
Identyfikator przypisany przez Classroom. Tylko do odczytu.
|
userId |
string
Identyfikator zaproszonego użytkownika. Gdy jest on określony jako parametr żądania, może mieć jedną z tych wartości:
- identyfikator liczbowy użytkownika.
- adres e-mail użytkownika.
- ciąg znaków
"me" wskazujący użytkownika, który wysłał żądanie;
|
courseId |
string
Identyfikator zajęć, do których chcesz zaprosić użytkownika.
|
role |
enum (CourseRole )
Rola, jaką ma mieć zaproszony użytkownik. Nie może to być wartość COURSE_ROLE_UNSPECIFIED .
|
CourseRole
Możliwe role, które użytkownik może przyjąć.
Wartości w polu enum |
COURSE_ROLE_UNSPECIFIED |
Brak roli na zajęciach. |
STUDENT |
Uczestnik kursu. |
TEACHER |
Nauczyciel prowadzący zajęcia. |
OWNER |
Właściciel zajęć. |
Metody |
|
akceptuje zaproszenie, usuwa je i dodaje zaproszonego użytkownika do listy nauczycieli lub uczniów (w zależności od tego, co jest odpowiednie) w określonym kursie. |
|
Tworzy zaproszenie. |
|
Usuwa zaproszenie. |
|
Zwraca zaproszenie. |
|
Zwraca listę zaproszeń, które użytkownik może wyświetlić, ograniczając się do tych, które pasują do żądania listy. |
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,["# REST Resource: invitations\n\n- [Resource: Invitation](#Invitation)\n - [JSON representation](#Invitation.SCHEMA_REPRESENTATION)\n- [CourseRole](#CourseRole)\n- [Methods](#METHODS_SUMMARY)\n\nResource: Invitation\n--------------------\n\nAn invitation to join a course.\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"id\": string, \"userId\": string, \"courseId\": string, \"role\": enum (/workspace/classroom/reference/rest/v1/invitations#CourseRole) } ``` |\n\n| Fields ||\n|------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `id` | `string` Identifier assigned by Classroom. Read-only. |\n| `userId` | `string` Identifier of the invited user. When specified as a parameter of a request, this identifier can be set to one of the following: - the numeric identifier for the user - the email address of the user - the string literal `\"me\"`, indicating the requesting user |\n| `courseId` | `string` Identifier of the course to invite the user to. |\n| `role` | `enum (`[CourseRole](/workspace/classroom/reference/rest/v1/invitations#CourseRole)`)` Role to invite the user to have. Must not be `COURSE_ROLE_UNSPECIFIED`. |\n\nCourseRole\n----------\n\nPossible roles a user may be invite to have.\n\n| Enums ||\n|---------------------------|------------------------|\n| `COURSE_ROLE_UNSPECIFIED` | No course role. |\n| `STUDENT` | Student in the course. |\n| `TEACHER` | Teacher of the course. |\n| `OWNER` | Owner of the course. |\n\n| Methods ------- ||\n|-------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|\n| ### [accept](/workspace/classroom/reference/rest/v1/invitations/accept) | Accepts an invitation, removing it and adding the invited user to the teachers or students (as appropriate) of the specified course. |\n| ### [create](/workspace/classroom/reference/rest/v1/invitations/create) | Creates an invitation. |\n| ### [delete](/workspace/classroom/reference/rest/v1/invitations/delete) | Deletes an invitation. |\n| ### [get](/workspace/classroom/reference/rest/v1/invitations/get) | Returns an invitation. |\n| ### [list](/workspace/classroom/reference/rest/v1/invitations/list) | Returns a list of invitations that the requesting user is permitted to view, restricted to those that match the list request. |"]]