이제 Google 클래스룸 부가기능이 일반적으로 개발자에게 제공됩니다. 자세한 내용은
부가기능 문서를 참고하세요.
Google Classroom API 오류 구조
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Classroom API는 개발자가 문제를 디버그하고 최종 사용자에게 유용하고 실행 가능한 정보를 제공하는 데 도움이 되는 오류 정보를 반환합니다. 이 가이드에서는 API에서 반환된 오류 정보를 파싱하는 방법을 설명합니다.
Classroom API는 두 가지 수준의 오류 정보를 반환합니다.
- 헤더의 HTTP 오류 코드입니다.
- 추가 세부정보가 포함된 응답 본문의 객체입니다.
오류 메시지 구조
응답 본문에 반환된 오류에는 다음 필드가 포함됩니다.
code
: 숫자 HTTP 오류 코드입니다. 예를 들면 다음과 같습니다. 403
message
: 오류에 관한 추가 세부정보입니다. 사용 가능한 경우 오류 메시지 앞에 @
및 특정 오류 유형이 추가됩니다. 예를 들면 @ClassroomApiDisabled
입니다.
status
: HTTP 요청 상태입니다. 예를 들면 PERMISSION_DENIED
또는 NOT_FOUND
입니다.
ClassroomApiDisabled
오류로 요청이 실패한 경우 응답은 다음과 같습니다.
{
"error": {
"code": 403,
"message": "@ClassroomApiDisabled The user is not permitted to access the Classroom API.",
"status": "PERMISSION_DENIED"
}
}
응답 본문을 사용하여 오류의 원인을 디버그하고 사용자에게 유용한 정보를 제공할 수 있습니다. 특정 오류 메시지를 확인할 때는 동일한 문자열로 시작하는 다른 값과 일치하지 않도록 후행 공백을 포함하세요. 제공된 오류 예시에서 메시지 필드가 "@ClassroomApiDisabled "
로 시작하는지 확인하여 사용자에게 적절한 정보를 표시할 수 있습니다.
Classroom API에서 반환될 수 있는 일부 오류에 대한 자세한 내용은 일반적인 오류 페이지를 참고하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-29(UTC)
[null,null,["최종 업데이트: 2025-08-29(UTC)"],[],[],null,["# Google Classroom API error structure\n\nThe Classroom API returns error information that can help developers\ndebug issues and provide helpful, actionable information to end users. This\nguide explains how to parse error information returned from the API.\n\nThe Classroom API returns two levels of error information:\n\n- HTTP error code in the header.\n- An object in the response body with additional details.\n\nError message structure\n-----------------------\n\nErrors returned in the response body include the following fields:\n\n- `code`: The numerical HTTP error code. For example, `403`.\n- `message`: Additional details about the error. When available, the error message is prepended with `@` and a specific error type. For example, `@ClassroomApiDisabled`.\n- `status`: The HTTP request status. For example, `PERMISSION_DENIED` or `NOT_FOUND`.\n\nIf a request failed with a [`ClassroomApiDisabled`](/workspace/classroom/troubleshooting/common-errors#classroom-api-disabled) error, the response would\nbe: \n\n {\n \"error\": {\n \"code\": 403,\n \"message\": \"@ClassroomApiDisabled The user is not permitted to access the Classroom API.\",\n \"status\": \"PERMISSION_DENIED\"\n }\n }\n\nYou can use the response body to help you debug the cause of the error and\nprovide helpful information to users. Include a trailing space when checking\nfor a specific error message to avoid matching other values that start with\nthe same string. In the provided error example, you can check if the message\nfield begins with `\"@ClassroomApiDisabled \"` to present appropriate information\nto users.\n\nReference the [Common errors](/workspace/classroom/troubleshooting/common-errors) page for information on some errors that\ncan be returned by the Classroom API."]]