Detailed API error information is provided through a standard HTTP status code and a JSON error object in the response body. Generally, HTTP status codes 4xx indicate client errors, while 5xx indicate server errors.
Detailed error information is provided in the following format in the response body:
{ "code": "ERROR_CODE", "description": "error description"}Here are common error codes:
| HTTP status code | Code | Description |
|---|---|---|
| 400 | BAD_REQUEST | The server cannot process the request because the request format or body is invalid. |
| 400 | INVALID_PARAMETER | There is an error in the format or content of the requested parameter. |
| 400 | INVALID_{RESOURCE} | There is an error in the content of the requested resource. |
| 400 | MISSING_PARAMETER | A required parameter was not specified. |
| 400 | LIMIT_EXCEEDED | The limit for a parameter or resource property value was exceeded. |
| 400 | OUT_OF_RANGE | The parameter or resource property value is out of range. |
| 401 | UNAUTHORIZED | The requested authentication information was missing or incorrectly specified. A common authentication error indicates what is defined in RFC 6749. |
| 403 | FORBIDDEN | The server understood the client's request but refused to process it. If the client app does not have access to the resource or the required OAuth scopes, access is denied. |
| 403 | ACCESS_DENIED | Access to the requested resource is restricted. |
| 403 | LIMIT_EXCEEDED | The limit for the requested resource was exceeded. |
| 403 | OUT_OF_RANGE | The expected range for the requested resource was exceeded. |
| 404 | NOT_FOUND | The requested resource could not be found. |
| 404 | {RESOURCE}_NOT_EXIST | The specific resource could not be found. |
| 409 | CONFLICT | There is a conflict with the requested resource. |
| 409 | ALREADY_EXIST | The requested resource already exists. |
| 409 | {RESOURCE}_ALREADY_EXIST | The specific resource already exists. |
| 410 | DELETED | The requested resource has already been deleted and does not exist on the server. |
| 500 | INTERNAL_SERVER_ERROR | Unspecified internal server error |
| 503 | SERVICE_UNAVAILABLE | Temporary server error |
If the access token specified in the header is invalid when making an API request, you can check the cause of the error from the www-authenticate response header, which is what is defined in RFC 6750.
The structure of the WWW-authenticate header is as follows:
www-authenticate {auth-scheme} {auth-param}, {auth-param}...| HTTP status code | www-authenticate | Error case |
|---|---|---|
| 400 | www-authenticate: Bearer error="invalid_request" | The requested parameter format is invalid. |
| 401 | www-authenticate: Bearer error="invalid_token" | The access token is invalid. |
| 403 | www-authenticate: Bearer error="insufficient_scope", scope="{scope list}" | The access token does not have a scope to use this API. |
Note
- The www-authenticate header does not respond to every error case. Note that this is response information only included in certain cases when the HTTP status code is 400, 401, or 403.