Create

Creates an invitation

4 variables
4 variables

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 or if the user already has this role or a role with greater permissions.
  • ALREADY_EXISTS if an invitation for the specified user and course already exists

Authorization

To use this building block you will have to grant access to at least one of the following scopes:

  • Manage your Google Classroom class rosters

Input

This building block consumes 4 input parameters

  = Parameter name
  = Format

courseId STRING

Identifier of the course to invite the user to

id STRING

Identifier assigned by Classroom.

Read-only

role ENUMERATION

Role to invite the user to have. Must not be COURSE_ROLE_UNSPECIFIED

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

Output

This building block provides 4 output parameters

  = Parameter name
  = Format

courseId STRING

Identifier of the course to invite the user to

id STRING

Identifier assigned by Classroom.

Read-only

role ENUMERATION

Role to invite the user to have. Must not be COURSE_ROLE_UNSPECIFIED

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