Using Google Classroom API, I am simply trying to create a coursework (assignment) where I can assign the Drive folder for that coursework then I can upload attachments into that specific folder.
I've tried on the browser with their API Explorer and also does not work.
Here's my code;
const classroom = google.classroom({version: 'v1', auth});
classroom.courses.courseWork.create({
"courseId": assignmentCreationRequest.courseId,
"resource": {
"title": assignmentCreationRequest.title,
"description": assignmentCreationRequest.description,
"workType": "ASSIGNMENT",
"state": "PUBLISHED",
"topicId": assignmentCreationRequest.topicId,
"assignment":
{
"studentWorkFolder": {
"id": "1wTM6YYAk1rp4TtsEQwjZnb3qMbR9iPbe"
}
}
}
})
The folder has been created inside the Classroom courses folder as parent.
The only way I found working to create such folder is; when creating a coursework, add materials where the share mode is set to 'STUDENT_COPY', then the API will create a folder themselves. It's a workaround where I can delete all of the contents once the folder is created, but surely there's a classier way?
Any help would be massively appreciated!