Classroom Service Stay organized with collections Save and categorize content based on your preferences.
Page Summary
The Classroom service in Apps Script allows you to use the Google Classroom API to manage courses and rosters.
This is an advanced service that requires enabling before use.
The Classroom service utilizes the same objects, methods, and parameters as the public Google Classroom API.
Sample code is provided to demonstrate listing courses using the service.
The Classroom service allows you to use the Google Classroom API in Apps Script. This API gives admins, teachers, and students the ability to view and manage their courses and rosters.
Reference
For detailed information on this service, see the reference documentation for the Google Classroom API. Like all advanced services in Apps Script, the Classroom service uses the same objects, methods, and parameters as the public API. For more information, see How method signatures are determined.
/** * Lists 10 course names and IDs. */functionlistCourses(){/** * @see https://developers.google.com/classroom/reference/rest/v1/courses/list */constoptionalArgs={pageSize:10,// Use other query parameters here if needed.};try{constresponse=Classroom.Courses.list(optionalArgs);constcourses=response.courses;if(!courses||courses.length===0){console.log("No courses found.");return;}// Print the course names and IDs of the available courses.for(constcourseincourses){console.log("%s (%s)",courses[course].name,courses[course].id);}}catch(err){// TODO (developer)- Handle Courses.list() exception from Classroom APIconsole.log("Failed with error %s",err.message);}}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-12-03 UTC."],[],[]]