GOAL: I am trying to use Google Apps Script & the Google Classroom API to generate a student for a Google Classroom class.
ERROR: Code: 404 & message: Requested entity was not found.
CODE:
Classroom.Courses.Students.create(
{
"userId": "bwayne@school.edu",
"profile": {
"name": {
"givenName": "Bruce",
"familyName": "Wayne"
}
}
}, 14496468106);
THOUGHTS: I have tried many different variations replacing the course id with the a method to retrieve the code (ie. Classroom.Courses.list().courses[0].id) and the project scoped alias (ie. "p:abc123"). When I put in an incorrect courseId I receive the same error. Also, when I replace the userId with my email or the String "me" returns an error of code: 403, message: The caller does not have permission. When I replace the userId with a friend's ID there is an error message, the caller does not have permission.
This may have something to do with permissions or formatting, but I haven't been able to figure out how to get this code to work.
Thank you for your time! Jeremy