Create

Adds a user as a student of a course

19 variables
17 variables

Adds a user as a student of a course.

This method returns the following error codes:

  • PERMISSION_DENIED if the requesting user is not permitted to create students in this course or for access errors.
  • NOT_FOUND if the requested course ID does not exist.
  • FAILED_PRECONDITION if the requested user's account is disabled, for the following request errors:
    • CourseMemberLimitReached
    • CourseNotModifiable
    • UserGroupsMembershipLimitReached
  • ALREADY_EXISTS if the user is already a student or teacher in the course

Authorization

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

  • View the email addresses of people in your classes
  • View the profile photos of people in your classes
  • Manage your Google Classroom class rosters

Input

This building block consumes 19 input parameters

  = Parameter name
  = Format

courseId STRING Required

Identifier of the course to create the student in. This identifier can be either the Classroom-assigned identifier or an alias

enrollmentCode STRING

Enrollment code of the course to create the student in. This code is required if userId corresponds to the requesting user; it may be omitted if the requesting user has administrative permissions to create students for any user

courseId STRING

Identifier of the course.

Read-only

profile OBJECT

Global information for a user

profile.emailAddress STRING

Email address of the user.

Read-only

profile.photoUrl STRING

URL of user's profile photo.

Read-only

profile.permissions[] OBJECT

Global user permission description

profile.permissions[].permission ENUMERATION

Permission value

profile.name OBJECT

Details of the user's name

profile.name.givenName STRING

The user's first name.

Read-only

profile.name.familyName STRING

The user's last name.

Read-only

profile.name.fullName STRING

The user's full name formed by concatenating the first and last name values.

Read-only

profile.id STRING

Identifier of the user.

Read-only

profile.verifiedTeacher BOOLEAN

Represents whether a G Suite for Education user's domain administrator has explicitly verified them as being a teacher. If the user is not a member of a G Suite for Education domain, than this field will always be false.

Read-only

studentWorkFolder OBJECT

Representation of a Google Drive folder

studentWorkFolder.title STRING

Title of the Drive folder.

Read-only

studentWorkFolder.alternateLink STRING

URL that can be used to access the Drive folder.

Read-only

studentWorkFolder.id STRING

Drive API resource ID

userId STRING

Identifier of the user.

When specified as a parameter of a request, this identifier can be 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 17 output parameters

  = Parameter name
  = Format

courseId STRING

Identifier of the course.

Read-only

profile OBJECT

Global information for a user

profile.emailAddress STRING

Email address of the user.

Read-only

profile.photoUrl STRING

URL of user's profile photo.

Read-only

profile.permissions[] OBJECT

Global user permission description

profile.permissions[].permission ENUMERATION

Permission value

profile.name OBJECT

Details of the user's name

profile.name.givenName STRING

The user's first name.

Read-only

profile.name.familyName STRING

The user's last name.

Read-only

profile.name.fullName STRING

The user's full name formed by concatenating the first and last name values.

Read-only

profile.id STRING

Identifier of the user.

Read-only

profile.verifiedTeacher BOOLEAN

Represents whether a G Suite for Education user's domain administrator has explicitly verified them as being a teacher. If the user is not a member of a G Suite for Education domain, than this field will always be false.

Read-only

studentWorkFolder OBJECT

Representation of a Google Drive folder

studentWorkFolder.title STRING

Title of the Drive folder.

Read-only

studentWorkFolder.alternateLink STRING

URL that can be used to access the Drive folder.

Read-only

studentWorkFolder.id STRING

Drive API resource ID

userId STRING

Identifier of the user.

When specified as a parameter of a request, this identifier can be one of the following:

  • the numeric identifier for the user
  • the email address of the user
  • the string literal "me", indicating the requesting user