Are your users using Classroom with Google Meet? Check out the Apps Script quickstart covering how to check student attendence in Google Meet courses.

Request Errors

A Classroom API error can contain an error code to help you identify the cause and properly handle the error. Depending on the code, you might retry the request or direct users to take certain action.

This page details the possible error codes, grouped by HTTP code. To read more about the error message's structure, refer to Error Message Structure.

This page details the possible error codes, grouped by HTTP code. See the reference documentation to determine which methods return any particular error code.

HTTP 400: FAILED_PRECONDITION

A FAILED_PRECONDITION is returned when the user attempts an action that cannot be permitted, either because the user has hit a limit or an application state, such as CourseNotModifiable. To fix a FAILED_PRECONDITION, instruct the user to take some action and then retry. Or, in some cases, you might use alternative endpoints to fix the state on behalf of the user.

CourseMemberLimitReached

CourseMemberLimitReached indicates that the attempted action would exceed the maximum allowed number of course members. This code is typically returned by the students.create() For further information, refer to the "Class size limits" section of the Invite students to a class help center article.

Possible Action

Describe the cause of the failure and suggest that the user remove unnecessary course members

CourseNotModifiable

CourseNotModifiable indicates that the relevant course is in a state that doesn't allow its properties to be modified (other than the course state itself).

Possible Action

Prompt the user to change the course to a modifiable course state. To change the state, use courses.patch(). The course state can be changed in a request that changes other properties.

CourseTeacherLimitReached

CourseTeacherLimitReached indicates that the requested action would exceed the maximum allowed number of course teachers. This code is typically returned by the teachers.create(). For further information, refer to the "Class size limitations" section of the Add a co-teacher to a class help center article.

Possible Action

Describe the cause of the failure and suggest that the user remove unnecessary course teachers. If applicable to your app, you can use teachers.delete() to manage teacher rosters on behalf of the user.

UserGroupsMembershipLimitReached

UserGroupsMembershipLimitReached indicates that the user is already a member of the maximum allowed number of groups and can't join any courses. This code is typically returned by students.create() or teachers.create(). For further information, refer to the "Class size limitations" section of the Invite students to a class help center article.

Possible Action

Describe the cause of the failure and suggest that the user leave any courses in which they are not participating. The user may consider creating an additional account if they need to participate in more courses. If applicable to your app, you can use students.create() or teachers.delete() to manage rosters on behalf of the user.

AttachmentNotVisible

AttachmentNotVisible indicates that one or more attachments specified are either not visible to the user, not of the requested type, or do not exist. For example, Drive items that haven’t been shared to the user would return this error.

Possible Action

Describe the cause of the failure and suggest that the user recheck the identifiers, such as Drive file IDs, they have included. Also, ensure the user has the proper permissions to view the attachment.

HTTP 403: PERMISSION_DENIED

The Classroom API returns a PERMISSION_DENIED (HTTP 403) error when the requested action is not permitted because of an access or authorization issue.

MissingGrant

MissingGrant is returned if a client attempts to register for Push Notifications, but Classroom is unable to confirm that the requesting user has granted access to the requesting Cloud project with scopes appropriate for the feed type requested. Currently, this most commonly occurs when a service account using domain-wide delegation of authority attempts to register for Push Notifications, which is not currently supported without an active OAuth grant.

HTTP 429: RESOURCE_EXHAUSTED

The RESOURCE_EXHAUSTED is returned when the requested action is not permitted because some resource, such as quota or server capacity, is exhausted. These types of request errors typically occur because your app produced an excessive load.

To avoid triggering these limits and increase the reliability of your application, use retry mechanisms. Valid retry mechanisms include:

  • Use truncated exponential backoff to retry the request and maximize throughput of requests in concurrent environments.

  • To avoid collisions, consider truncated exponential backoff with jitter. Introducing jitter can help your requests succeed faster by introducing a randomized delay that spreads out spikes in requests.

If your application returns RESOURCE_EXHAUSTED errors due to quota limitations, submit a quota increase. For further information, refer to the Monitor API quotas help center article.

UserCourseJoinRateLimitReached

UserCourseJoinRateLimitReached indicates that the user has already joined the maximum allowed number of courses in one day. For further information, refer to the "Group invitations and size" section of the Understand Groups policies and limits help center article.

Possible Action

Describe the cause of the failure and suggest that the user waits one day before joining the course.

HTTP 500: INTERNAL

INTERNAL indicates that an unexpected error arose while processing the request. INTERNAL request errors can also often be solved by using exponential backoff to retry the request. If an INTERNAL error persists, it can be reported by filing a bug on the Classroom API public issue tracker.