Receiving 403 when Google Classrom list courseWork API for a teacher enrolled in the course - google-classroom

I am calling the Google Classroom API GET https://classroom.googleapis.com/v1/courses/{courseId}/courseWork
on behalf of a teacher who is enrolled in the given courseId. The API is returning HttpError 403 when requesting
https://classroom.googleapis.com/v1/courses/courseId/courseWork?alt=json returned "The caller does not have permission">
This teacher has the correct scopes to my knowledge to call this API 'https://www.googleapis.com/auth/classroom.rosters.readonly', 'https://www.googleapis.com/auth/classroom.coursework.students',
'https://www.googleapis.com/auth/classroom.profile.emails', 'https://www.googleapis.com/auth/classroom.courses.readonly'
I'm able to get the course information and list both the teachers and students without any issues. I'm unclear on why this endpoint is returning permission denied.
Any ideas/suggestions are appreciated.

Related

Google Classroom Error 400 InactiveCourseOwner

I am attempting to add a teacher to a course. I am assigning the teacher as the owner of the course. This is new course and this teacher is active in Google Admin but I am still getting this error. What should be my next steps?
After speaking with Google Support, they found that the user (teacher) was deleted and recreated with the same email the next day. The classrooms were attached to the old instance of the email. This is what was causing the 400 InactiveCourseOwner error.

403 org_internal Error with branded YouTube channel on GSuite API Credentials

We have a client_secret setted-up for blocking non-organization users from access on our internal CRM.
Using the same client credentials, we will wish to be able to upload videos, through our CRM, directly on our official Brand YouTube channel.
There is a problem though: linked to the main GSuite organization account, there are two youtube channels, one nominal and one branded.
Trying to generate a token for uploading videos on the main branded channel, through our client_secret, during the authentication phase the API responds with:
Errore 403: org_internal
This client is restricted to users within its organization.
Richiedi dettagli
access_type=offline
o2v=1
response_type=code
redirect_uri=https://CRM_DOMAIN/oauth2callback
client_id=***
prompt=consent
scope=https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/youtube https://www.googleapis.com/auth/youtube.upload https://www.googleapis.com/auth/youtube.force-ssl
So the question is: how to behave in this situation? Is it possible to link the branded channel directly to the GSuite organization without losing the name?
I tried to move the Brand channel by connecting it directly within my GSuite organization, but the channel is renamed with my name and no longer with the brand name, making it impossible for me to change the channel name because the Name and Surname fields are mandatory.
Thank you

Invite guardians from the same domain to Google Classroom

I'm trying to invite a guardian to a Classroom course using Api Explorer. The student and the guardian's emails are in the same domain (as in the case that a school teacher has a son attending his school). The requests returns OK, but the invitation email never comes. I've tried with the same student with emails from other domains and everything runs fine. I've found nothing in documentation about this, neither in Classroom nor Admin Console.

Google Classroom API modifyAttachments

When executing the courses.courseWork.studentSubmissions.modifyAttachments method in the Google Classroom API, a 403 error is returned when I try to add the attachment to the student's submission.
GoogleJsonResponseException:
{
"code" : 403,
"errors" : [ {
"domain" : "global",
"message" : "#ProjectPermissionDenied The Developer Console project is not permitted to make this request.",
"reason" : "forbidden"
} ],
"message" : "#ProjectPermissionDenied The Developer Console project is not permitted to make this request.",
"status" : "PERMISSION_DENIED"
}
The call is being made from an authenticated student account and being added as a Link resource. The Developer Console project DOES have the Google Classroom API enabled, and other calls to the Google Classroom API are working fine, such as courses.list and courses.courseWork.studentSubmissions.get. What am I missing? The same error is returned when using the Try it! app in the Google Classroom documentation site.
When modifying assignments/courseWork or student submissions, only the Developer console project that created those objects can modify them. This means that only projects that created the corresponding course work can modify them, otherwise a 403 PERMISSION_DENIED error is returned. You can easily determine if the course work item is associated with the Developer Console project making the request by checking the associatedWithDeveloper property on the Google Classroom course work response.
It took me a while to figure this out myself, but the best way to go in my opinion is to first create the coursework (i.e. assignment or question) itself with Google Script or using the Classroom API. The coursework is then associated with the correct console project and you are cleared to manage the submissions from thereon.
All Classroom API methods may return a PERMISSION_DENIED (HTTP 403) error if an end user does not meet prerequisites for access. The message accompanying the error contains an error message to help you identify the cause and direct users to take the appropriate action.
ProjectPermissionDenied indicates that the request attempted to modify a resource associated with a different Developer Console project.
Possible Action: Indicate that your application cannot make the desired request. It can only be made by the Developer Console project of the OAuth client ID that created the resource.

how to view current user's facebook birthday notifications on graph api

So I am currently making a Birthday App.
and when I use the Koala Facebook api graph I cannot get ahold of the current user's birthday connections. I can get all other notifications and some birthday announcements in the feed. Can anyone help?
You can only get the birthday of the authorized user, with the user_birthday permission. You can NOT get the birthdays of his friends, friend permissions have been removed.
Meaning, a birthday App would only make sense between authorized users.

Resources