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.
The following sections describe the API error messages.
CannotDirectAddUser indicates that a user cannot be directly added to the course. This code happens when a domain administrator tries to add a user to a course and that user either does not have an email address or does not belong to the domain.
Possible Action: Describe the cause of the failure and suggest that the domain admin check that the user account exists and is within the course admin's domain.
ClassroomDisabled indicates that the requesting user does not have access to Classroom.
Possible Action: Direct the user to instructions on enabling Classroom access. The user may also be using the wrong account, so you might also provide a link to using multiple accounts so the user can select the correct account.
ClassroomApiDisabled indicates that the requesting user does not have access to the Classroom API.
Possible Action: Direct the user to instructions on enabling Classroom data access. Also see ClassroomDisabled, as the user may be using the wrong account.
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.