Access Errors

Access Errors

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

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

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

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

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.

UserIneligibleToUpdateGradingPeriodSettings

UserIneligibleToUpdateGradingPeriodSettings indicates that the request attempted to modify grading period settings in a course where the requesting user or the course owner do not have the appropriate Google Workspace for Education license.

Possible Action: Indicate that your application cannot make the desired request to update grading period settings due to the licensing status of the requesting user or the owner of the course. Licenses can be assigned in the Google Admin console.