working with classroom

Important note

Google Apps script can only be used to make changes that the user running the script has permission for. For example, the user can create or modify their own courses, but not those of other teachers. Or they can invite the guardians for students enrolled on one of their courses, but not for other students. On the subject of inviting — that is also usually the limit. So, students, teachers, guardians can be sent an invitation, but they can’t simply be added outright.

The exception to the above is when the user running the script has “administrator” privileges — then pretty much anything is possible! You should be very careful about running scripts using an admin account, though — you could accidentally delete your colleague’s course, for instance, or enroll every student in the school to the wrong course! All of the examples below assume that you are not using an admin account, and therefore focus on the user’s own courses and own students.