In order to use Google Classroom efficiently, we started development with Google Spreadsheets and Google Apps Script.
Currently, I want to archive a large number of Classroom classes at once.

Current status/questions

Even if I read the above reference, I am having trouble understanding the description when performing Classroom.Courses.patch from GAS.

For example, if I want to change the courseState of a course with course ID "01234567890" to "ARCHIVED",
What kind of code will it be?

  • Answer # 1

    I solved it below.

    var id = "01234567890"
    var course = {"courseState": "ARCHIVED"};
    Classroom.Courses.patch (course, id, {'updateMask':'courseState'});

Related articles