HTTP Status Codes
Last updated:2021-12-15
HTTP Status Codes
This document defines the HTTP response code specification for JPush REST APIs.
The new version of JPush Push API v3 follows this specification. JPush Report API also follows this specification.
Status Code Definitions
| Code | Description | Detailed Explanation |
|---|---|---|
| 200 | OK | Success! |
| 400 | Bad request | The request is invalid. The corresponding description explains the reason. |
| 401 | Unauthorized | No authentication information was provided, or authentication failed. |
| 403 | Rejected | The request is understood but not accepted. The corresponding description explains the reason. |
| 404 | Not found | The resource does not exist, the requested user does not exist, or the request format is not supported. |
| 405 | Method not allowed | This API does not support this request method. |
| 410 | Offline | The requested resource has been taken offline. See relevant announcements. |
| 429 | Too many requests | The request exceeded the frequency limit. The corresponding description explains the specific reason. |
| 500 | Internal server error | An internal server error occurred. Please contact us so we can resolve it as soon as possible. |
| 502 | Bad gateway | The business server is offline or being upgraded. Please try again later. |
| 503 | Service temporarily unavailable | The server cannot respond to the request. Please try again later. |
| 504 | Gateway timeout | The server is running but cannot respond to the request. Please try again later. |
Rules
- 200 always indicates success. Exceptions never use the 200 response code.
- For business logic errors, use a specific 4xx error code whenever possible; otherwise, use 400.
- For internal server errors without a specific error code, use 500.
- When a business exception occurs, define the error information in JSON format in the response body.
References
Was this document helpful?