RapidIdentity Product Guide: New UI

Google Classroom Adapter Actions

The Google Classroom Adapter depends on the Google Apps Adapter and requires it to be licensed. Google Classroom actions require a connection created with defineGoogleAppsOAuthConnection(). The OAuth Credential used must have the classroom related scopes enabled, which are not selected by default.

Add an Alias to a Google Classroom Course.

Property

Value

Description

connection*

expression, variable

the Google Apps connection definition

courseId*

text, expression, variable

the id of the Course

alias*

text, expression, variable

the Alias to add

returnVariable

expression, variable

name of the variable to be assigned to the return value

Example

# add a domain scoped alias to the course
newAlias = addGoogleClassroomCourseAlias(conn, courseId, 
    "d:English101Section2")

Add a Google Apps User to a Google Classroom Course as a Student.

Property

Value

Description

connection*

expression, variable

the Google Apps connection definition

courseId*

text, expression, variable

the id of the Course

userId*

text, expression, variable

the id of the Student to add to the Course

returnVariable

expression, variable

name of the variable to be assigned to the return value

Example

# add a student to course
newStudent = addGoogleClassroomCourseStudent(conn, 
    "d:English101Section2", "john.doe@example.com")

Add a batch of Google Apps Users to a Google Classroom Course as Students.

Property

Value

Description

connection*

expression, variable

the Google Apps connection definition

courseId*

text, expression, variable

the id of the Course

userIds*

text, expression, variable

array of ids to add to the Course

returnVariable

expression, variable

name of the variable to be assigned to the return value

Example

# add students to course
newStudents = addGoogleClassroomCourseStudents(conn, 
    "d:English101Section2", ["john.doe@example.com", 
    "jane.doe@example.com"])

Add a Google Apps User to a Google Classroom Course as a Teacher.

Property

Value

Description

connection*

expression, variable

the Google Apps connection definition

courseId*

text, expression, variable

the id of the Course

userId*

text, expression, variable

the id of the Teacher to add to the Course

returnVariable

expression, variable

name of the variable to be assigned to the return value

Example

# add a teacher to course
newTeacher = addGoogleClassroomCourseTeacher(conn, 
    "d:English101Section2", "juan.fulano@example.com")

Add a batch of Google Apps Users to a Google Classroom Course as Teachers.

Property

Value

Description

connection*

expression, variable

the Google Apps connection definition

courseId*

text, expression, variable

the id of the Course

userIds*

text, expression, variable

array of ids to add to the Course

returnVariable

expression, variable

name of the variable to be assigned to the return value

Example

# add teachers to course
newStudents = addGoogleClassroomCourseTeachers(conn, 
    "d:English101Section2", ["juan.fulano@example.com", 
    "maria.fulano@example.com"])

Delete a Google Classroom Course record by Id.

Property

Value

Description

connection*

expression, variable

the Google Apps connection definition

id*

text, expression, variable

the id of the Course to delete

returnVariable

expression, variable

name of the variable to be assigned to the return value

Example

# delete a course
deleted = deleteGoogleClassroomCourse(conn, 
    "d:English101Section2")

Delete an Alias from a Google Classroom Course.

Property

Value

Description

connection*

expression, variable

the Google Apps connection definition

courseId*

text, expression, variable

the id of the Course

alias*

text, expression, variable

the Alias to delete

returnVariable

expression, variable

name of the variable to be assigned to the return value

Example

# delete the alias from the course
deleted = deleteGoogleClassroomCourse(conn, courseId, 
    "d:English101Section2")

Delete an Invitation to a Google Classroom Course.

Property

Value

Description

connection*

expression, variable

the Google Apps connection definition

id*

text, expression, variable

the id of the Invitation

returnVariable

expression, variable

name of the variable to be assigned to the return value

Example

# get the invitation so we can find its id
invitation = getGoogleClassroomCourseInvitations(conn, 
    {courseId: courseId, userId: "juan.fulano@example.com"})
# delete the invitation
deleted = deleteGoogleClassroomCourseInvitation(conn, invitation.id)

Delete a batch of Invitations to Google Classroom Courses.

Property

Value

Description

connection*

expression, variable

the Google Apps connection definition

ids*

text, expression, variable

array of ids to delete

returnVariable

expression, variable

name of the variable to be assigned to the return value

Example

# get all invitations to a course
invitations = getGoogleClassroomCourseInvitations(conn, 
    {courseId: courseId})
# extract the ids
invitationIds = createArray()
forEach(invitation, invitations) {
    appendArrayElement(invitationIds, invitation.id)
}
deleted = deleteGoogleClassroomCourseInvitations(conn, 
    invitationIds)

Delete a batch of Google Classroom Course record by Id.

Property

Value

Description

connection*

expression, variable

the Google Apps connection definition

ids*

text, expression, variable

array of the Google Classroom User ids to delete

returnVariable

expression, variable

name of the variable to be assigned to the return value

Example

# delete courses
deleted = deleteGoogleClassroomCourses(conn, [course1Id, course2Id])

Delete a Student from a Google Classroom Course.

Property

Value

Description

connection*

expression, variable

the Google Apps connection definition

courseId*

text, expression, variable

the id of the Course

userId*

text, expression, variable

the id of the Student to delete from the Course

returnVariable

expression, variable

name of the variable to be assigned to the return value

Example

# remove a student from course
deleted = deleteGoogleClassroomCourseStudent(conn, courseId, 
    "john.doe@example.com")

Delete a batch of Students from a Google Classroom Course.

Property

Value

Description

connection*

expression, variable

the Google Apps connection definition

courseId*

text, expression, variable

the id of the Course

userIds*

text, expression, variable

array of ids to remove from the Course

returnVariable

expression, variable

name of the variable to be assigned to the return value

Example

# remove students from course
deleted = deleteGoogleClassroomCourseStudents(conn, courseId, 
    ["john.doe@example.com", "jane.doe@example.com"])

Delete a Teacher from a Google Classroom Course.

Property

Value

Description

connection*

expression, variable

the Google Apps connection definition

courseId*

text, expression, variable

the id of the Course

userId*

text, expression, variable

the id of the Teacher to delete from the Course

returnVariable

expression, variable

name of the variable to be assigned to the return value

Example

# remove a teacher from course
deleted = deleteGoogleClassroomCourseTeacher(conn, courseId, 
    "juan.fulano@example.com")

Delete a batch of Teachers from a Google Classroom Course.

Property

Value

Description

connection*

expression, variable

the Google Apps connection definition

courseId*

text, expression, variable

the id of the Course

userIds*

text, expression, variable

array of ids to remove from the Course

returnVariable

expression, variable

name of the variable to be assigned to the return value

Example

# remove teachers from course
deleted = deleteGoogleClassroomCourseTeachers(conn, courseId, 
    ["juan.fulano@example.com", "maria.fulano@example.com"])

Get a Google Classroom Course record by Id.

Property

Value

Description

connection*

expression, variable

the Google Apps connection definition

id*

text, expression, variable

the id of the Course to get

returnVariable

expression, variable

name of the variable to be assigned to the return value

Example

# get a course
course = getGoogleClassroomCourse(conn, courseId, English101Section2")

Get the aliases for a Google Classroom Course.

Property

Value

Description

connection*

expression, variable

the Google Apps connection definition

courseId*

text, expression, variable

the id of the Course

returnVariable

expression, variable

name of the variable to be assigned to the return value

Example

# get the aliases for a course
aliases = getGoogleClassroomCourseAliases(conn, courseId)

Get list of outstanding Google Classroom Course Invitations.

Property

Value

Description

connection*

expression, variable

the Google Apps connection definition

filter*

text, expression, variable

filter to limit the Invitations returned (default: none)

returnVariable

expression, variable

name of the variable to be assigned to the return value

Example

# get the outstanding invitations for a course
invitations = getGoogleClassroomCourseInvitations(conn, {courseId: 
    courseId})

Get Google Classroom Course records.

Property

Value

Description

connection*

expression, variable

the Google Apps connection definition

filter

text, expression, variable

filter to limit the Courses returned (default: none)

returnVariable

expression, variable

name of the variable to be assigned to the return value

Example

# get the courses that a student is enrolled in
courses = getGoogleClassroomCourses(conn, 
    {studentId: "john.doe@example.com"})

Get batch of Google Classroom Course records by Id.

Property

Value

Description

connection*

expression, variable

the Google Apps connection definition

ids*

text, expression, variable

array of the Google Classroom User ids to get

returnVariable

expression, variable

name of the variable to be assigned to the return value

Example

# get the courses by id
courses = getGoogleClassroomCoursesByID(conn, [course1Id, course2Id])

Get the list of Students from a Google Classroom Course.

Property

Value

Description

connection*

expression, variable

the Google Apps connection definition

courseId*

text, expression, variable

the id of the Course

returnVariable

expression, variable

name of the variable to be assigned to the return value

Example

# get the students from a course
students = getGoogleClassroomCourseStudents(conn, courseId)

Get the list of Teachers from a Google Classroom Course.

Property

Value

Description

connection*

expression, variable

the Google Apps connection definition

courseId*

text, expression, variable

the id of the Course

returnVariable

expression, variable

name of the variable to be assigned to the return value

Example

# get the students from a course
teacher = getGoogleClassroomCourseTeachers(conn, courseId)

Invite a batch of Google Apps Users to a Google Classroom Course.

Property

Value

Description

connection*

expression, variable

the Google Apps connection definition

courseId*

text, expression, variable

the id of the Course

userIds*

text, expression, variable

array of ids to invite to the Course

role*

choice (STUDENT, TEACHER), text, expression, variable

the role of the invited Users

returnVariable

expression, variable

name of the variable to be assigned to the return value

Example

# invite students to a course
invitations = inviteUsersToGoogleClassroomCourse(conn, courseId, 
    ["john.doe@example.com", "jane.doe@example.com"], "STUDENT")

Invite a Google Apps User to a Google Classroom Course.

Property

Value

Description

connection*

expression, variable

the Google Apps connection definition

courseId*

text, expression, variable

the id of the Course

userId*

text, expression, variable

the id of the User to invite to the Course

role*

choice (STUDENT, TEACHER), text, expression, variable

the role of the invited User

returnVariable

expression, variable

name of the variable to be assigned to the return value

Example

# invite a teacher to a course
invitations = inviteUserToGoogleClassroomCourse(conn, courseId, 
    "maria.fulano.doe@example.com"], "TEACHER")

Open Google Classroom Course Iterator.

Property

Value

Description

connection*

expression, variable

the Google Apps connection definition

filter

text, expression, variable

filter to limit the Courses returned (default: none)

returnVariable

expression, variable

name of the variable to be assigned to the return value

Example

# iterate all the courses in the domain
courses = openGoogleClassroomCourseIterator(conn)
forEach(course, courses) {
# do something
}

Property

Value

Description

connection*

expression, variable

the Google Apps connection definition

record*

expression, variable

the record to save

returnVariable

expression, variable

name of the variable to be assigned to the return value

Example

# create a new course
courseTemplate = createRecord()
setRecordFieldValue(courseTemplate, "name", "English 101");
setRecordFieldValue(courseTemplate, "section", "A");
setRecordFieldValue(courseTemplate, "descriptionHeading", 
    "Welcome to English 101");
setRecordFieldValue(courseTemplate, "description", "Remedial English");
setRecordFieldValue(courseTemplate, "room", "222", false);
setRecordFieldValue(courseTemplate, "ownerId", "admin@example.com");
setRecordFieldValue(courseTemplate, "courseState", "ACCEPTED");
setRecordFieldValue(courseTemplate, "alias", "English-101-Section-A");
newCourse = saveGoogleClassroomCourse(conn, courseTemplate); 

Create/Update a batch of Google Classroom Course records.

Property

Value

Description

connection*

expression, variable

the Google Apps connection definition

records*

expression, variable

array of records to save

array of records to save

expression, variable

name of the variable to be assigned to the return value

Example

# create 3 sections of new course
courseTemplates = createArray()
forEach(section, ["A", "B", "C"])
    courseTemplate = createRecord()
    setRecordFieldValue(courseTemplate, "name", "English 101")
    setRecordFieldValue(courseTemplate, "section", section)
    setRecordFieldValue(courseTemplate, "descriptionHeading", 
        "Welcome to English 101")
    setRecordFieldValue(courseTemplate, "description", "Remedial English")
    setRecordFieldValue(courseTemplate, "room", "222", false)
    setRecordFieldValue(courseTemplate, "ownerId", "admin@example.com")
    setRecordFieldValue(courseTemplate, "courseState", "ACCEPTED")
    setRecordFieldValue(courseTemplate, "alias", "English-101-Section-" 
        + section)
    appendArrayElement(courseTemplates, courseTemplate)
}
newCourse = saveGoogleClassroomCourses(conn, courseTemplates)