Google Classroom add-ons are now generally available to developers! Please see the
add-ons documentation for more information.
Method: invitations.create
Creates an invitation. Only one invitation for a user and course may exist at a time. Delete and re-create an invitation to make changes.
This method returns the following error codes:
PERMISSION_DENIED
if the requesting user is not permitted to create invitations for this course or for access errors.
NOT_FOUND
if the course or the user does not exist.
FAILED_PRECONDITION
:
- if the requested user's account is disabled.
- if the user already has this role or a role with greater permissions.
- for the following request errors:
ALREADY_EXISTS
if an invitation for the specified user and course already exists.
HTTP request
POST https://classroom.googleapis.com/v1/invitations
The URL uses gRPC Transcoding syntax.
Request body
The request body contains an instance of Invitation
.
Response body
If successful, the response body contains a newly created instance of Invitation
.
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/classroom.rosters
For more information, see the Authorization guide.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-04 UTC.
[null,null,["Last updated 2024-09-04 UTC."],[[["Creates an invitation for a user to join a course, allowing only one active invitation per user and course at a time."],["Requires `https://www.googleapis.com/auth/classroom.rosters` authorization scope for successful execution."],["Returns an error if the user already has an invitation, the course or user doesn't exist, or the requesting user lacks permission."],["Uses an HTTP POST request to `https://classroom.googleapis.com/v1/invitations` with the invitation details in the request body."],["Upon successful creation, returns the newly created invitation details in the response body."]]],[]]