Search code examples
google-classroom

Is there a way to GET lists of course work for ALL courses in one request (Method: courses.courseWork.list Google Classroom API)


Is there a way to GET lists of course work for ALL courses in one request (Method: courses.courseWork.list Google Classroom API). Right now, it works only by one single courseId per request Thank you

function execute() {
return gapi.client.classroom.courses.courseWork.list({
"courseId": "7777777777777",
"courseWorkStates": [
"PUBLISHED"
]
})

Solution

  • It is not possible, it needs the 'courseId' parameter to return the data. A workaround would be listing all the courses with 'Method: courses.list' [1], get the Id's for all courses and create a cycle so it gets the course work for all courses.

    [1] https://developers.google.com/classroom/reference/rest/v1/courses/list