Reputation: 2076
I am trying to access the student list endpoint for Google Classroom.
I have successfully obtained my OAUTH2 token, I have requested the following scopes:
Every time that I try to retrieve the class list I am getting a 403 Permission denied and I'm wondering what I'm doing wrong.
Two things to mention: Here is a screenshot showing the permissions I have granted:
And, interestingly, even after having added the permissions, on the google project
page where it lists the number of users using sensitive scopes - it is listed as zero (which is odd, I'd have thought it should be 1)
Any pointers would be really helpful!
Upvotes: 1
Views: 403
Reputation: 1
/api/v1/courses/:course_id/students
is deprecated.
Instead use:
/api/v1/courses/:course_id/users?enrollment_type[]=student
Upvotes: 0
Reputation: 2076
Not a very satisfactory answer, but, if I add the https://www.googleapis.com/auth/classroom.rosters.readonly
scope, then it allows me access and returns the email addresses at the same time (when calling the v1/courses/{courseId}/students
endpoint)
If however you only have the rosters scope, then you can still access the v1/courses/{courseId}/students
endpoint, but, you just don't get the email addresses returned.
Quite confusing to me.
Upvotes: 1