오류 처리
API는 기존 HTTP 응답 코드를 사용하여 API 요청의 결과를 나타냅니다.
- 2xx 범위의 코드는 성공을 나타내고,
- 4xx 범위의 코드는 클라이언트 오류 (요청 파라미터 누락, 유효하지 않음 등),
- 5xx 범위의 코드는 서버 내부 오류를 의미합니다.
API 오류 메시지는 헤더에 JSON 형식과 HTTP 상태로 반환되며,
형식은 다음과 같이 구성됩니다:
error_code
, error_type
, error_description
4XX Error Code
400 BAD REQUEST
Code |
Type |
Description |
40001 | Invalid Body Parameters | The entries provided as body parameters were not valid. |
40002 | Invalid Query Parameters | The entries provided as query parameters were not valid. |
40003 | Missing Required Body Parameters | The request is missing some required body parameters. |
40004 | Missing Required Query Parameters | The request is missing the required query parameters. |
40005 | Rule Violation | The request violated some logic requirement. |
40006 | Missing Required Header Parameters | The request is missing some required header parameters. |
40007 | Invalid Path Parameters | The entries provided as path parameters were not valid. |
401 UNAUTHORIZED
Code |
Type |
Description |
401001 | Invalid Key | The method requires authentication, but it was not presented or is invalid. |
403 FORBIDDEN
Code |
Type |
Description |
403001 | Access Denied | The authentication token is restricted and cannot access the resource. |
403002 | Account Limit | The plan limit for a resource has been reached. |
403003 | Forbidden Action | The plan is restricted and cannot perform this action. |
404 NOT FOUND
Code |
Type |
Description |
404001 | Not Found | A resource id was not found. |
5XX Error Code
500 INTERNAL SERVER ERROR
Code |
Type |
Description |
500001 | Unknown | Possibly a temporary issue due to downtime. Wait and retry. |