Last active
May 13, 2023 13:50
-
-
Save ochilab/cf74603038b2fb0095bcc08fbe9e834a to your computer and use it in GitHub Desktop.
GAS:自分が参加しているクラスの情報を取得する(Google Classroom API)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getClassList(){ | |
var optionalArgs = { | |
pageSize: 100 //クラスの数が多い場合はここを増やす | |
}; | |
var response = Classroom.Courses.list(optionalArgs); | |
var courses = response.courses; | |
if (courses && courses.length > 0) { | |
for (i in courses) { | |
var course = courses[i]; | |
Logger.log(course.name); | |
Logger.log(course.id); | |
} | |
return course; | |
} else { | |
Logger.log('クラスが見つかりません'); | |
return null; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment