List more than 30 students in a class in Google Classroom API query Ask Question code example
Example: List more than 30 students in a class in Google Classroom API query Ask Question
const roster = [],
options = {pageSize: };
do {
var search = Classroom.Courses.Students.list(courseId, options);
if (search.students)
Array.prototype.push.apply(roster, search.students);
options.pageToken = search.nextPageToken;
} while (options.pageToken);
Logger.log("There are %s students in class # %s", roster.length, courseId);