- Notifications
You must be signed in to change notification settings - Fork484
Classroom Courses
- API documentation
- Notes
- Python Regular Expressions Match function
- Definitions
- Special quoting for course aliases and topics
- Updating course owner
- Create and update courses
- Delete courses
- Manage course aliases
- Manage course announcements
- Manage course topics
- Display courses
- Display course counts
- Display course announcements
- Display course materials
- Display course topics
- Display course work
- Display course submissions
- Google Classroom API
- Google Classroom API - Courses Students
- Google Classroom API - Courses Teachers
- Google Classroom API - Announcements
- Google Classroom API - Topics
- Google Classroom API - Course Work
- Google Classroom API - Course Work Materials
- Google Classroom API - Course Work Student Submissions
In this document,course materials
refers to stand-alone materials, not the materials associated withcourse announcements
orcourse work
. Google added support for stand-alone materials in early 2021.
To use the course materials features you must authorize the appropriate scope:Classroom API - Course Work/Materials
.
gam oauth creategam user user@domain.com check|update serviceaccount
<DomainName> ::= <String>(.<String>)+<EmailAddress> ::= <String>@<DomainName><UniqueID> ::= id:<String><UserItem> ::= <EmailAddress>|<UniqueID>|<String><RegularExpression> ::= <String> See: https://docs.python.org/3/library/re.html<REMatchPattern> ::= <RegularExpression><RESearchPattern> ::= <RegularExpression><RESubstitution> ::= <String>><CourseAlias> ::= <String><CourseAliasList> ::= "<CourseAlias>(,<CourseAlias>)*"<CourseAliasEntity> ::= <CourseAliasList>|<FileSelector>|<CSVFileSelector>|<CSVkmdSelector>|<CSVDataSelector> See: https://github.com/GAM-team/GAM/wiki/Collections-of-Items<CourseAnnouncementContent> ::= ((text <String>)| (textfile <FileName> [charset <Charset>])| (gdoc <UserGoogleDoc>)| (gcsdoc <StorageBucketObjectName>))<CourseAnnouncementID> ::= <Number><CourseAnnouncementIDList> ::= "<CourseAnnouncementID>(,<CourseAnnouncementID>)*"<CourseAnnouncementIDEntity> ::= <CourseAnnouncementIDList>|<FileSelector>|<CSVFileSelector>|<CSVkmdSelector>|<CSVSubkeySelector>|<CSVDataSelector> See: https://github.com/GAM-team/GAM/wiki/Collections-of-Items<CourseAnnouncementState> ::= draft|published|deleted<CourseAnnouncementStateList> ::= all|"<CourseAnnouncementState>(,<CourseAnnouncementState>)*"<CourseID> ::= <Number>|d:<CourseAlias><CourseIDList> ::= "<CourseID>(,<CourseID>)*"<CourseEntity> ::= <CourseIDList>|<FileSelector>|<CSVFileSelector>|<CSVkmdSelector> See: https://github.com/GAM-team/GAM/wiki/Collections-of-Items<CourseMaterialID> ::= <Number><CourseMaterialIDList> ::= "<CourseMaterialID>(,<CourseMaterialID>)*"<CourseMaterialState> ::= draft|published|deleted<CourseMaterialStateList> ::= all|"<CourseMaterialState>(,<CourseMaterialState>)*"<CourseMaterialIDEntity> ::= <CourseMaterialIDList> | <FileSelector> | <CSVFileSelector> | <CSVkmdSelector> | <CSVSubkeySelector> | <CSVDataSelector> See: https://github.com/GAM-team/GAM/wiki/Collections-of-Items<CourseState> ::= active|archived|provisioned|declined|suspended<CourseStateList> ::= all|"<CourseState>(,<CourseState>)*"<CourseSubmissionID> ::= <Number><CourseSubmissionIDList> ::= "<CourseSubmissionID>(,<CourseSubmissionID>)*"<CourseSubmissionIDEntity> ::= <CourseSubmissionIDList>|<FileSelector>|<CSVFileSelector>|<CSVDataSelector> See: https://github.com/GAM-team/GAM/wiki/Collections-of-Items<CourseSubmissionState> ::= new|created|turned_in|returned|reclaimed_by_student<CourseSubmissionStateList> ::= all|"<CourseSubmissionState>(,<CourseSubmissionState>)*"<CourseTopic> ::= <String><CourseTopicList> ::= "<CourseTopic>(,<CourseTopic>)*"<CourseTopicEntity> ::= <CourseTopicList> | <FileSelector> | <CSVFileSelector> | <CSVkmdSelector> | <CSVDataSelector> See: https://github.com/GAM-team/GAM/wiki/Collections-of-Items<CourseTopicID> ::= <Number><CourseTopicIDList> ::= "<CourseTopicID>(,<CourseTopicID>)*"<CourseTopicIDEntity> ::= <CourseTopicIDList>|<FileSelector>|<CSVFileSelector>|<CSVkmdSelector>|<CSVSubkeySelector>|<CSVDataSelector> See: https://github.com/GAM-team/GAM/wiki/Collections-of-Items<CourseWorkID> ::= <Number><CourseWorkIDList> ::= "<CourseWorkID>(,<CourseWorkID>)*"<CourseWorkIDEntity> ::= <CourseWorkIDList>|<FileSelector>|<CSVFileSelector>|<CSVkmdSelector>|<CSVSubkeySelector>|<CSVDataSelector> See: https://github.com/GAM-team/GAM/wiki/Collections-of-Items<CourseWorkState> ::= draft|published|deleted<CourseWorkStateList> ::= all|"<CourseWorkState>(,<CourseWorkState>)*"<CourseAttribute> ::= (description <String>)| (descriptionheading|heading <String>)| (name <String>)| (room <String>)| (section <string>)| (state|status <CourseState>)| (owner|ownerid|teacher <UserItem>)<CourseFieldName> ::= alternatelink| coursegroupemail| coursematerialsets| coursestate| creationtime| description| descriptionheading|heading| enrollmentcode| gradebooksettings| guardiansenabled| id| name| owneremail| ownerid| room| section| teacherfolder| teachergroupemail| updatetime<CourseFieldNameList> ::= '<CourseFieldName>(,<CourseFieldName>)*'<CourseAnnouncementFieldName> ::= alternatelink| assigneemode| courseid| courseannouncementid| creationtime| creator|creatoruserid| id| individualstudentsoptions| materials| scheduledtime| state| text| updatetime<CourseAnnouncementFieldNameList> ::= "<CourseAnnouncementFieldName>(,<CourseAnnouncementFieldName>)*"<CourseAnnouncementOrderByFieldName> ::= updatetime| updatedate<CourseMaterialFieldName> ::= alternatelink| assigneemode| courseid| courseworkmaterialid| creationtime| creator|creatoruserid| description| id| individualstudentsoptions| materials| scheduledtime| state| title| topicid| updatetime| workmaterialid<CourseMaterialFieldNameList> ::= "<CourseMaterialFieldName>(,<CourseMaterialFieldName>)*"<CourseMaterialOrderByFieldName> ::= updatetime| updatedate<CourseWorkFieldName> ::= alternatelink| assigneemode| courseid| courseworkid| courseworktype| creationtime| creator|creatoruserid| description| duedate| duetime| id| individualstudentsoptions| materials| maxpoints| scheduledtime| state| submissionmodificationmode| title| topicid| updatetime| workid| worktype<CourseWorkFieldNameList> ::= "<CourseWorkFieldName>(,<CourseWorkFieldName>)*"<CourseWorkOrderByFieldName> ::= duedate| updatetime| updatedate<CourseSubmissionFieldName> ::= alternatelink| assignedgrade| courseid| courseworkid| courseworktype| creationtime| draftgrade| id| late| state| submissionhistory| updatetime| userid| worktype<CourseSubmissionFieldNameList> ::= "<CourseSubmissionFieldName>(,<CourseSubmissionFieldName>)*"
As course aliases and topics can contain spaces, some care must be used when entering<CourseAliasList>
and<CourseTopicList>
.
Suppose you have a course with the aliasMath Class
. To get information about it you enter the command:gam info course "d:Math Class"
The shell strips the"
leaving a single argumentd:Math Class
; gam correctly processes the argument as it is expecting a single course.
Suppose you enter the command:gam info courses "d:Math Class"
The shell strips the"
leaving a single argumentd:Math Class
; as gam is expecting a list, it splits the argument on space leaving two items and then tries to processd:Math
andClass
, not what you want.
You must enter:gam info courses "'d:Math Class'"
The shell strips the"
leaving a single argument'd:Math Class'
; as gam is expecting a list, it splits the argument on space while honoring the'
leaving one itemd:Math Class
and correctly processes the item.
For multiple aliases you must enter:gam info courses "'d:Math Class','d:Science Class'"
When updating a course owner, the Classroom API generates an error if the new owner is not a co-teacheror is the current owner.
If<UserItem>
is not a co-teacher, GAM adds<UserItem>
as a co-teacher of the course,pauses 10 seconds, and then updates them to be the owner.
$ gam update course 123929046789 teacher newteacher@domain.comCourse Name: Test, Course: 123929046789, Updated with new teacher as owner: newteacher@domain.com
If<UserItem>
is the current owner, GAM now reports that the current owner was retained.
$ gam update course 123929046789 teacher newteacher@domain.comCourse Name: Test, Course: 123929046789, Updated with current owner: newteacher@domain.com
In the normal case when<UserItem>
is a co-teacher, GAM now reports the change.
$ gam update course 123929046789 teacher newteacher@domain.comCourse Name: Test, Course: 123929046789, Updated with co-teacher as owner: newteacher@domain.com
The optionsname <String>
andteacher <UserItem>
are required when creating a class.
gam create|add course [id|alias <CourseAlias>] <CourseAttribute>* [copyfrom <CourseID> [announcementstates <CourseAnnouncementStateList>] [individualstudentannouncements copy|delete|maptoall] [materialstates <CourseMaterialStateList>] [individualstudentmaterials copy|delete|maptoall] [workstates <CourseWorkStateList>] [individualstudentcoursework copy|delete|maptoall] [removeduedate [<Boolean>]] [mapsharemodestudentcopy edit|none|view] [individualstudentassignments copy|delete|maptoall] [copymaterialsfiles [<Boolean>]] [copytopics [<Boolean>]] [markdraftaspublished [<Boolean>]] [markpublishedasdraft [<Boolean>]] [members none|all|students|teachers]] [logdrivefileids [<Boolean>]]gam update course <CourseID> <CourseAttribute>+ [copyfrom <CourseID> [announcementstates <CourseAnnouncementStateList>] [individualstudentannouncements copy|delete|maptoall] [materialstates <CourseMaterialStateList>] [individualstudentmaterials copy|delete|maptoall] [workstates <CourseWorkStateList>] [individualstudentcoursework copy|delete|maptoall] [removeduedate [<Boolean>]] [mapsharemodestudentcopy edit|none|view] [individualstudentassignments copy|delete|maptoall] [copymaterialsfiles [<Boolean>]] [copytopics [<Boolean>]] [markdraftaspublished [<Boolean>]] [markpublishedasdraft [<Boolean>]] [members none|all|students|teachers]] [logdrivefileids [<Boolean>]]gam update courses <CourseEntity> <CourseAttribute>+ [copyfrom <CourseID> [announcementstates <CourseAnnouncementStateList>] [individualstudentannouncements copy|delete|maptoall] [materialstates <CourseMaterialStateList>] [individualstudentmaterials copy|delete|maptoall] [workstates <CourseWorkStateList>] [individualstudentcoursework copy|delete|maptoall] [removeduedate [<Boolean>]] [mapsharemodestudentcopy edit|none|view] [individualstudentassignments copy|delete|maptoall] [copymaterialsfiles [<Boolean>]] [copytopics [<Boolean>]] [markdraftaspublished [<Boolean>]] [markpublishedasdraft [<Boolean>]] [members none|all|students|teachers]] [logdrivefileids [<Boolean>]]
copyfrom <CourseID>
allows copying of course announcements, work, topics and members from one course to another.
- Accouncements - By default, no course announcements are copied
announcementstates <CourseAnnouncementStateList>
- Copy class announcements with the specified statesindividualstudentannouncements copy
- Copy individual student announcements; this is the default. You will get an error if a student is not a member of the courseindividualstudentannouncements delete
- Delete individual student announcementsindividualstudentannouncements maptoall
- Map individual student announcements to all student announcements
- Materials - By default, no course materials are copied
materialstates <CourseMaterialsStateList>
- Copy class materials with the specified statesindividualstudentmaterials copy
- Copy individual student materials; this is the default. You will get an error if a student is not a member of the courseindividualstudentmaterials delete
- Delete individual student materialsindividualstudentmaterials maptoall
- Map individual student materials to all student materials
- Work - By default, no course work is copied
workstates <CourseWorkStateList>
- Copy class work with the specified statesindividualstudentcoursework copy
- Copy individual student coursework; this is the default. You will get an error if the student is not a member of the courseindividualstudentcoursework delete
- Delete individual student courseworkindividualstudentcoursework maptoall
- Map individual student coursework to all student courseworkremoveduedate false
- Remove due dates before the current time; this is the defaultremoveduedate|removeduedate true
- Remove all due dates
- For convenience, setting
individualstudentassignments
sets all the following to the same value:individualstudentannouncements
individualstudentmaterials
individualstudentcoursework
- Announcements, Materials and Work Materials files
copymaterialsfiles false
- Copy links to files referenced by materials in thecopyfrom
course; this is the defaultcopymaterialsfiles|copymaterialsfiles true
- Copy files referenced by materials in thecopyfrom
course- You must verify that the teacher of the course being created/updated has access to the files in the
copyfrom
course - Files can only be copied to a course that is ACTIVE; GAM will adjust the course state as necessary
- You must verify that the teacher of the course being created/updated has access to the files in the
- Topics - By default, no course topics are copied; if topics are not copied, references to them will be deleted from class work that is copied
copytopics false
- No course topics are copiescopytopics|copytopics true
- Copy topics
- Published Material and Work - By default, published material and work is not relabeled
markdraftaspublished false
- Do not relabel draft material/work as published; this is the defaultmarkdraftaspublished|markpublishedasdraft true
- Relabel draft material/work as publishedmarkpublishedasdraft false
- Do not relabel published material/work as draft; this is the defaultmarkpublishedasdraft|markpublishedasdraft true
- Relabel published material/work as draft
- Members - By default, no course members are copied
members none
- No course members are copiedmembers all
- Copy course students and teachersmembers students
- Copy studentsmembers teachers
- Copy teachers
When true,logdrivefileids [<Boolean>]
generates a CSV file with headers `courseId,ownerId,fileId' thatlists all drive files in the course.
The Classroom API does not support course materials of typeform
, they will not be copied.
Drive files withshareMode
Each student will get a copy
don't seem to be able to be copied.
mapsharemodestudentcopy edit
- MapEach student will get a copy
toStudents can edit file
mapsharemodestudentcopy view
- MapEach student will get a copy
toStudents can view file
mapsharemodestudentcopy none
or not specified - NoshareMode
mapping is performed, you may get an error
Classes can only be deleted when they are in the ARCHIVED state; to delete a class, you can update its state to ARCHIVEDand then delete it or you can specify that it be archived as parot of the delete command.
gam delete course <CourseID> [archived]gam delete courses <CourseEntity> [archived]
These commands can process a single course.
gam course <CourseID> add alias <CourseAlias>gam course <CourseID> delete alias <CourseAlias>
These commands can process multiple courses.
gam courses <CourseEntity> add alias <CourseAliasEntity>gam courses <CourseEntity> delete alias <CourseAliasEntity>
These commands can process a single course.
gam course <CourseID> add announcement <CourseAnnouncementContent> [scheduledtime <Time>] [state draft|published]gam course <CourseID> delete announcement <CourseAnnouncementID>gam course <CourseID> update announcement <CourseAnnouncementID> [<CourseAnnouncementContent>] [scheduledtime <Time>] [state published]
These commands can process multiple courses.
gam courses <CourseEntity> add announcement <CourseAnnouncementContent> [scheduledtime <Time>] [state draft|published]gam courses <CourseEntity> delete announcement <CourseAnnouncementIDEntity>gam courses <CourseEntity> update announcement <CourseAnnouncementIDEntity> [<CourseAnnouncementContent>] [scheduledtime <Time>] [state published]
These commands can process a single course.
gam course <CourseID> add topic <CourseTopic>gam course <CourseID> delete topic <CourseTopicID>gam course <CourseID> update topic <CourseTopicID> <CourseTopic>
These commands can process multiple courses.
gam courses <CourseEntity> add topic <CourseTopicEntity>gam courses <CourseEntity> delete topic <CourseTopicIDEntity>gam courses <CourseEntity> update topic <CourseTopicIDEntity> <CourseTopic>
gam info course <CourseID> [owneremail] [alias|aliases] [show all|students|teachers] [countsonly] [fields <CourseFieldNameList>] [skipfields <CourseFieldNameList>] [formatjson]gam info courses <CourseEntity> [owneremail] [alias|aliases] [show all|students|teachers] [countsonly] [fields <CourseFieldNameList>] [skipfields <CourseFieldNameList>] [formatjson]gam print courses [todrive <ToDriveAttribute>*] (course|class <CourseEntity>)*|([teacher <UserItem>] [student <UserItem>] [states <CourseStateList>]) [owneremail] [owneremailmatchpattern <REMatchPattern>] [alias|aliases|aliasesincolumns [delimiter <Character>]] [show all|students|teachers] [countsonly] [fields <CourseFieldNameList>] [skipfields <CourseFieldNameList>] [formatjson [quotechar <Character>]] [timefilter creationtime|updatetime] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>]
By default, theprint courses
command displays information about all courses.
To get information about a specific set of courses, use the following option; it can be repeated to select multiple courses.
(course|class <CourseEntity>)*
- Display courses with the IDs specified in<CourseEntity>
.
To get information about courses based on its owner's emailaddress, use theowneremailmatchpattern <REMatchPattern>
option.
foo@bar.com
- Display courses with a specific owner emailaddress..*test.*
- Display courses with an owner emailaddress that matches a pattern.Unknown user
- Display courses where the owner emailaddress has been deleted.
To get information about courses based on their having a particular participant, use the following options. Both options can be specified.
teacher <UserItem>
- Display courses with the specified teacher.student <UserItem>
- Display courses with the specified student.
To get information about courses based on their state, use the following option. This option can be combined with theteacher
andstudent
options.By default, all course states are selected.
states <CourseStateList>
- Display courses with any of the specified states.
To get information about courses created/updated within a particular time frame, use the following options.
timefilter creationtime|updatetime
- select which event to filterstart|starttime <Date>|<Time>
- specify the start of the time frame; if not specified, the time frame will be open ended at the startend|endtime <Date>|<Time>
- specify the end of the time frame; if not specified, the time frame will be open ended at the endFor the filter to apply,timefilter
and at least one ofstart|starttime
andend|endtime
must be specified.
By default, all basic course fields are displayed; use the following options to modify the output.
owneremail
- Display course owner email; requires an additional API call per course.alias|aliases
- Display course aliases; all aliases are in the single columnAliases
separated by a delimiter; requires an additional API call per course.delimiter <Character>
- Delimiter between aliases withprint
command.
aliasesincolumn
- Display course aliases; theAliases
column contains the number of aliases andAliases.0
,Aliases.1
, ... contain the individual aliases; requires an additional API call per course.show all|students|teachers
- Show class participants profile information; requires an additional API call per course.countsonly
- Eliminates the student/teacher profile information and outputs only the student/teacher counts.
fields <CourseFieldNameList>
- Select specific basic fields to display.skipfields <CourseFieldNameList>
- Select specific basic fields to eliminate from display; typically used withcoursematerialsets
.
By default, Gam displays the information as columns of fields; the following option causes the output to be in JSON format,
formatjson
- Display the fields in JSON format.
By default, when writing CSV files, Gam uses a quote character of double quote"
. The quote character is used to enclose columns that containthe quote character itself, the column delimiter (comma by default) and new-line characters. Any quote characters within the column are doubled.When using theformatjson
option, double quotes are used extensively in the data resulting in hard to read/process output.Thequotechar <Character>
option allows you to choose an alternate quote character, single quote for instance, that makes for readable/processable output.quotechar
defaults togam.cfg/csv_output_quote_char
. When uploading CSV files to Google, double quote"
should be used.
Display the number of courses.
gam print courses (course|class <CourseEntity>)*|([teacher <UserItem>] [student <UserItem>] [states <CourseStateList>]) [owneremailmatchpattern <REMatchPattern>] showitemcountonly
Example
$ gam print courses states active showitemcountonlyGetting all Courses that match query (Course State: ACTIVE), may take some time on a large Google Workspace Account...Got 268 Courses...Got 272 Courses...Got 272 Courses...272
TheGetting
andGot
messages are written to stderr, the count is writtem to stdout.
To retrieve the count withshowitemcountonly
:
Linux/MacOScount=$(gam print courses states active showitemcountonly)Windows PowerShellcount = & gam print courses states active showitemcountonly
gam print course-announcements [todrive <ToDriveAttribute>*] (course|class <CourseEntity>)*|([teacher <UserItem>] [student <UserItem>] states <CourseStateList>]) (courseannouncementids <CourseAnnouncementIDEntity>)|(announcementstates <CourseAnnouncementStateList>)* (orderby <CourseAnnouncementOrderByFieldName> [ascending|descending])*) [creatoremail] [fields <CourseAnnouncementFieldNameList>] [timefilter creationtime|updatetime|scheduledtime] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>] [countsonly] [formatjson [quotechar <Character>]]
By default, theprint course-announcements
command displays course announcement information for all courses.
To get course announcements for a specific set of courses, use the following option; it can be repeated to select multiple courses.
(course|class <CourseEntity>)*
- Display courses with the IDs specified in<CourseEntity>
.
To get course announcements for courses based on their having a particular participant, use the following options. Both options can be specified.
teacher <UserItem>
- Display courses with the specified teacher.student <UserItem>
- Display courses with the specified student.
To get course announcements for courses based on their state, use the following option. This option can be combined with theteacher
andstudent
options.By default, all course states are selected.
states <CourseStateList>
- Display courses with any of the specified states.
By default, all published course announcements for a course are displayed; use the following options to select specific course announcements.
courseannouncementids <CourseAnnouncementIDEntity>
- Display course announcements with the IDs specified in<CourseAnnouncementIDEntity>
.announcementstates <CourseAnnouncementStateList>
- Display course announcements with any of the specified states.
To get information about course announcements created/updated/scheduled within a particular time frame, use the following options.
timefilter creationtime|updatetime|scheduledtime
- select which event to filterstart|starttime <Date>|<Time>
- specify the start of the time frame; if not specified, the time frame will be open ended at the startend|endtime <Date>|<Time>
- specify the end of the time frame; if not specified, the time frame will be open ended at the endFor the filter to apply,timefilter
and at least one ofstart|starttime
andend|endtime
must be specified.
By default, all course announcement fields are displayed; use the following options to modify the output.
creatoremail
- Display course announcement creator email; requires an additional API call per course announcement.fields <CourseAnnouncementFieldNameList>
- Select specific fields to display.
Use thecountsonly
option to display the number of announcements in a course but not their details.
By default, Gam displays the information as columns of fields; the following option causes the output to be in JSON format,
formatjson
- Display the fields in JSON format.
By default, when writing CSV files, Gam uses a quote character of double quote"
. The quote character is used to enclose columns that containthe quote character itself, the column delimiter (comma by default) and new-line characters. Any quote characters within the column are doubled.When using theformatjson
option, double quotes are used extensively in the data resulting in hard to read/process output.Thequotechar <Character>
option allows you to choose an alternate quote character, single quote for instance, that makes for readable/processable output.quotechar
defaults togam.cfg/csv_output_quote_char
. When uploading CSV files to Google, double quote"
should be used.
gam print course-materials [todrive <ToDriveAttribute>*] (course|class <CourseEntity>)*|([teacher <UserItem>] [student <UserItem>] states <CourseStateList>]) (materialids <CourseMaterialIDEntity>)|(materialstates <CourseMaterialStateList>)* (orderby <CourseMaterialOrderByFieldName> [ascending|descending])*) [showcreatoremails|creatoremail] [showtopicnames] [fields <CourseMaterialFieldNameList>] [timefilter creationtime|updatetime|scheduledtime] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>] [countsonly] [formatjson [quotechar <Character>]]
By default, theprint course-materials
command displays course materials information for all courses.
To get course materials information for a specific set of courses, use the following option; it can be repeated to select multiple courses.
(course|class <CourseEntity>)*
- Display courses with the IDs specified in<CourseEntity>
.
To get course materials information for courses based on their having a particular participant, use the following options. Both options can be specified.
teacher <UserItem>
- Display courses with the specified teacher.student <UserItem>
- Display courses with the specified student.
To get course materials information for courses based on their state, use the following option. This option can be combined with theteacher
andstudent
options.By default, all course states are selected.
states <CourseStateList>
- Display courses with any of the specified states.
To get information about course materials created/updated/scheduled within a particular time frame, use the following options.
timefilter creationtime|updatetime|scheduledtime
- select which event to filterstart|starttime <Date>|<Time>
- specify the start of the time frame; if not specified, the time frame will be open ended at the startend|endtime <Date>|<Time>
- specify the end of the time frame; if not specified, the time frame will be open ended at the endFor the filter to apply,timefilter
and at least one ofstart|starttime
andend|endtime
must be specified.
By default, all published course materials for a course are displayed; use the following options to select specific course materials.
materialsids <CourseMaterialsIDEntity>
- Display course materials with the IDs specified in<CourseMaterialsIDEntity>
.materialsstates <CourseMaterialsStateList>
- Display course materials with any of the specified states.
By default, all course materials fields are displayed; use the following options to modify the output.
showcreatoremails
- Display course materials creator email; requires an additional API call per course materials.showtopicnames
- Display topic names; requires and additional API call per course.fields <CourseMaterialsFieldNameList>
- Select specific fields to display.
Use thecountsonly
option to display the number of course materials in a course but not their details.
By default, Gam displays the information as columns of fields; the following option causes the output to be in JSON format,
formatjson
- Display the fields in JSON format.
By default, when writing CSV files, Gam uses a quote character of double quote"
. The quote character is used to enclose columns that containthe quote character itself, the column delimiter (comma by default) and new-line characters. Any quote characters within the column are doubled.When using theformatjson
option, double quotes are used extensively in the data resulting in hard to read/process output.Thequotechar <Character>
option allows you to choose an alternate quote character, single quote for instance, that makes for readable/processable output.quotechar
defaults togam.cfg/csv_output_quote_char
. When uploading CSV files to Google, double quote"
should be used.
gam print course-topics [todrive <ToDriveAttribute>*] (course|class <CourseEntity>)*|([teacher <UserItem>] [student <UserItem>] states <CourseStateList>]) (coursetopicids <CourseTopicIDEntity>) [timefilter updatetime] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>] [countsonly] [formatjson [quotechar <Character>]]
By default, theprint course-topics
command displays course topic information for all courses.
To get course topics for a specific set of courses, use the following option; it can be repeated to select multiple courses.
(course|class <CourseEntity>)*
- Display courses with the IDs specified in<CourseEntity>
.
To get course topics for courses based on their having a particular participant, use the following options. Both options can be specified.
teacher <UserItem>
- Display courses with the specified teacher.student <UserItem>
- Display courses with the specified student.
To get course topics for courses based on their state, use the following option. This option can be combined with theteacher
andstudent
options.By default, all course states are selected.
states <CourseStateList>
- Display courses with any of the specified states.
By default, all published course topics for a course are displayed; use the following options to select specific course topics.
coursetopicids <CourseTopicIDEntity>
- Display course topics with the IDs specified in<CourseTopicIDEntity>
.topicstates <CourseTopicStateList>
- Display course topics with any of the specified states.
To get information about course topics updated within a particular time frame, use the following options.
timefilter updatetime
- select which event to filterstart|starttime <Date>|<Time>
- specify the start of the time frame; if not specified, the time frame will be open ended at the startend|endtime <Date>|<Time>
- specify the end of the time frame; if not specified, the time frame will be open ended at the endFor the filter to apply,timefilter
and at least one ofstart|starttime
andend|endtime
must be specified.
Use thecountsonly
option to display the number of topics in a course but not their details.
By default, Gam displays the information as columns of fields; the following option causes the output to be in JSON format,
formatjson
- Display the fields in JSON format.
By default, when writing CSV files, Gam uses a quote character of double quote"
. The quote character is used to enclose columns that containthe quote character itself, the column delimiter (comma by default) and new-line characters. Any quote characters within the column are doubled.When using theformatjson
option, double quotes are used extensively in the data resulting in hard to read/process output.Thequotechar <Character>
option allows you to choose an alternate quote character, single quote for instance, that makes for readable/processable output.quotechar
defaults togam.cfg/csv_output_quote_char
. When uploading CSV files to Google, double quote"
should be used.
gam print course-work [todrive <ToDriveAttribute>*] (course|class <CourseEntity>)*|([teacher <UserItem>] [student <UserItem>] states <CourseStateList>]) (workids <CourseWorkIDEntity>)|(workstates <CourseWorkStateList>)* (orderby <CourseWorkOrderByFieldName> [ascending|descending])*) [showcreatoremails] [showtopicnames] [fields <CourseWorkFieldNameList>] [showstudentsaslist [<Boolean>]] [delimiter <Character>] [timefilter creationtime|updatetime|scheduledtime] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>] [countsonly] [formatjson [quotechar <Character>]]
By default, theprint course-work
command displays course work information for all courses.
To get course work information for a specific set of courses, use the following option; it can be repeated to select multiple courses.
(course|class <CourseEntity>)*
- Display courses with the IDs specified in<CourseEntity>
.
To get course work information for courses based on their having a particular participant, use the following options. Both options can be specified.
teacher <UserItem>
- Display courses with the specified teacher.student <UserItem>
- Display courses with the specified student.
To get course work information for courses based on their state, use the following option. This option can be combined with theteacher
andstudent
options.By default, all course states are selected.
states <CourseStateList>
- Display courses with any of the specified states.
To get information about course work created/updated/scheduled within a particular time frame, use the following options.
timefilter creationtime|updatetime|scheduledtime
- select which event to filterstart|starttime <Date>|<Time>
- specify the start of the time frame; if not specified, the time frame will be open ended at the startend|endtime <Date>|<Time>
- specify the end of the time frame; if not specified, the time frame will be open ended at the endFor the filter to apply,timefilter
and at least one ofstart|starttime
andend|endtime
must be specified.
By default, all published course work for a course is displayed; use the following options to select specific course work.
workids <CourseWorkIDEntity>
- Display course work with the IDs specified in<CourseWorkIDEntity>
.workstates <CourseWorkStateList>
- Display course work with any of the specified states.
By default, all course work fields are displayed; use the following options to modify the output.
showcreatoremails
- Display course work creator email; requires an additional API call per course work.showtopicnames
- Display topic names; requires and additional API call per course.fields <CourseWorkFieldNameList>
- Select specific fields to display.
By default, when course work is assigned to individual students, the student IDs are displayed in multiple indexed columns.Use optionsshowstudentsaslist [<Boolean>]
anddelimiter <Character>
to display the student IDs is a single column as a delimited list.
Use thecountsonly
option to display the number of course works in a course but not their details.
By default, Gam displays the information as columns of fields; the following option causes the output to be in JSON format,
formatjson
- Display the fields in JSON format.
By default, when writing CSV files, Gam uses a quote character of double quote"
. The quote character is used to enclose columns that containthe quote character itself, the column delimiter (comma by default) and new-line characters. Any quote characters within the column are doubled.When using theformatjson
option, double quotes are used extensively in the data resulting in hard to read/process output.Thequotechar <Character>
option allows you to choose an alternate quote character, single quote for instance, that makes for readable/processable output.quotechar
defaults togam.cfg/csv_output_quote_char
. When uploading CSV files to Google, double quote"
should be used.
gam print course-submissions [todrive <ToDriveAttribute>*] (course|class <CourseEntity>)*|([teacher <UserItem>] [student <UserItem>] states <CourseStateList>]) (workids <CourseWorkIDEntity>)|(workstates <CourseWorkStateList>)* (orderby <CourseWorkOrderByFieldName> [ascending|descending])*) (submissionids <CourseSubmissionIDEntity>)|(submissionstates <CourseSubmissionStateList>)*) [late|notlate] [fields <CourseSubmissionFieldNameList>] [showuserprofile] [timefilter creationtime|updatetime] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>] [countsonly] [formatjson [quotechar <Character>]]
By default, theprint course-submissions
command displays course submission information for all course work for all courses.
To get course submission information for a specific set of courses, use the following option; it can be repeated to select multiple courses.
(course|class <CourseEntity>)*
- Display courses with the IDs specified in<CourseEntity>
.
To get course submission information for courses based on their having a particular participant, use the following options. Both options can be specified.
teacher <UserItem>
- Display courses with the specified teacher.student <UserItem>
- Display courses with the specified student.
To get course submission information for courses based on their state, use the following option. This option can be combined with theteacher
andstudent
options.By default, all course states are selected.
states <CourseStateList>
- Display courses with any of the specified states.
By default, all course work for a course is displayed; use the following options to select specific course work.
workids <CourseWorkIDEntity>
- Display course work with the IDs specified in<CourseWorkIDEntity>
.workstates <CourseWorkStateList>
- Display course work with any of the specified states.
By default, all course submissions for a course work is displayed; use the following options to select specific course submissions.
submissionids <CourseSubmissionIDEntity>
- Display course submissions with the IDs specified in<CourseSubmissionIDEntity>
.submissionstates <CourseSubmissionStateList>
- Display course submissions with any of the specified states.late
- Display course submissions marked late.notlate
- Display course submissions not marked late.
To get information about course submissions created/updated within a particular time frame, use the following options.
timefilter creationtime|updatetime
- select which event to filterstart|starttime <Date>|<Time>
- specify the start of the time frame; if not specified, the time frame will be open ended at the startend|endtime <Date>|<Time>
- specify the end of the time frame; if not specified, the time frame will be open ended at the endFor the filter to apply,timefilter
and at least one ofstart|starttime
andend|endtime
must be specified.
By default, all course submission fields are displayed; use the following options to modify the output.
fields <CourseSubmissionFieldNameList>
- Select specific fields to display.
By default, only the numeric userId is displayed; use theshowuserprofile
option to get the user email address and name.You can only get profile information if the scopehttps://www.googleapis.com/auth/classroom.profile.emails
is enabledfor service account access; verify withgam <UserTypeEntity> update serviceaccount
.
Use thecountsonly
option to display the number of submissions in a course but not their details.
By default, Gam displays the information as columns of fields; the following option causes the output to be in JSON format,
formatjson
- Display the fields in JSON format.
By default, when writing CSV files, Gam uses a quote character of double quote"
. The quote character is used to enclose columns that containthe quote character itself, the column delimiter (comma by default) and new-line characters. Any quote characters within the column are doubled.When using theformatjson
option, double quotes are used extensively in the data resulting in hard to read/process output.Thequotechar <Character>
option allows you to choose an alternate quote character, single quote for instance, that makes for readable/processable output.quotechar
defaults togam.cfg/csv_output_quote_char
. When uploading CSV files to Google, double quote"
should be used.
Need more help? Ask on theGAM Discussion Group orChat Space.
You can suggest edits to these Wiki pages by submitting pull requests againstthe wiki files.
oUpdate History
Installation
- How to Install GAM7
- How to Upgrade GAMADV-XTD3 to GAM7
- How to Upgrade Legacy GAM to GAM7
- How to Update GAM7
- Verifying a GAM7 Build is Legitimate and Official
- Install GAM as Python Library
- GAM7 on Chrome OS Devices
- GAM7 on Android Devices
- Google Network Addresses
- HTTPS Proxy
- SSL Root CA Certificates
- How to Uninstall GAM7
Configuration
- Authorization
- GAM Configuration
- Running GAM7 securely on a Google Compute Engine
- Using GAM7 with a delegated admin service account
- Using GAM7 with a YubiKey
- GAM with minimal GCP rights
Notes and Information
- Upgrade Benefits
- Questions? Visit the GAM Discussion Forum
- GAM Public Chat Room
- Scripts
- Other Resources
- Drive REST API v3
- BNF Syntax
- GAM Return Codes
- Python Regular Expressions
- Rclone
Definitions
Command Processing
- Bulk Processing
- Command Line Parsing
- Command Logging and Progress
- Command data from Google Docs/Sheets/Storage
- CSV Special Characters
- CSV Input Filtering
- CSV Output Filtering
- Meta Commands and File Redirection
- Permission matches
- Tag Replace
- Todrive
Collections
Client Access
- Addresses
- Administrators
- Alert Center
- Aliases
- Calendars
- Calendars - Access
- Calendars - Events
- Chrome Auto Update Expiration Counts
- Chrome Browser Cloud Management
- Chrome Device Needs Attention Counts
- Chrome Installed Apps
- Chrome Policies
- Chrome Printers
- Chrome Profile Management
- Chrome Version Counts
- Chrome Version History
- ChromeOS Devices
- Classroom - Courses
- Classroom - Guardians
- Classroom - Invitations
- Classroom - Membership
- Cloud Channel
- Cloud Identity Devices
- Cloud Identity Groups
- Cloud Identity Groups - Membership
- Cloud Identity Policies
- Cloud Storage
- Context Aware Access Levels
- Customer
- Domains
- Domains - Verification
- Domain People - Contacts & Profiles
- Domain Shared Contacts
- Email Audit Monitor
- Find File Owner
- Google Data Transfers
- Groups
- Groups - Membership
- Inbound SSO
- Licenses
- Mobile Devices
- Organizational Units
- Reports
- Reseller
- Resources
- Send Email
- Schemas
- Shared Drives
- Sites
- Unmanaged Accounts
- Users
- Users - Application Specific Passwords
- Users - Backup Verification Codes
- Users - Classroom - Profile
- Users - Contacts - Delegates
- Users - Deprovision
- Users - Group Membership
- Users - Photo
- Users - Profile Sharing
- Users - Signout and Turn off 2-Step Verification
- Users - Tokens
- Vault - Takeout
- Version and Help
Special Service Account Access
Service Account Access
- Users - Analytics Admin
- Users - Calendars
- Users - Calendars - Access
- Users - Calendars - Events
- Users - Chat
- Users - Classification Labels
- Users - Contacts
- Users - Drive - File Selection
- Users - Drive - Activity/Settings
- Users - Drive - Cleanup
- Users - Drive - Comments
- Users - Drive - Copy/Move
- Users - Drive - Files-Display
- Users - Drive - Files-Manage
- Users - Drive - Orphans
- Users - Drive - Ownership
- Users - Drive - Permissions
- Users - Drive - Query
- Users - Drive - Revisions
- Users - Drive - Shortcuts
- Users - Drive - Transfer
- Users - Forms
- Users - Gmail - Client Side Encryption
- Users - Gmail - Delegates
- Users - Gmail - Filters
- Users - Gmail - Forwarding
- Users - Gmail - Labels
- Users - Gmail - Messages/Threads
- Users - Gmail - Profile
- Users - Gmail - S/MIME
- Users - Gmail - SendAs/Signature/Vacation
- Users - Gmail - Settings
- Users - Keep - Notes
- Users - Looker Studio
- Users - Meet
- Users - Classroom - Profile
- Users - People - Contacts & Profiles
- Users - Profile Photo
- Users - Shared Drives
- Users - Spreadsheets
- Users - Tasks
- Users - YouTube
GAM Tutorials
- Account Auditing
- Calendar Settings
- Chat Bot commands
- Chrome Browser Management
- Chrome Policy Settings
- Context Aware Access levels
- Data Transfers
- Domain Verification
- Google Drive Management
- Group Settings
- Inbound SSO Settings
- Managing Admins
- Managing Classroom
- Managing Custom User Schemas
- Managing Devices
- Managing Organizations
- Managing Product Licenses
- Managing Users, Groups, Aliases, Domains, Mobile and Chrome Devices, and Resource Calendars
- OAuth Authentication Related Commands
- Print Users, Groups, Aliases, Mobile and Chrome OS devices, OUs, Licenses and Reports
- Printers
- Unmanaged Users and Invitations
- User Email Settings
- User Security Settings