The JAVIS API follows a consistent JSON error structure to help developers diagnose and resolve issues quickly. This section outlines common errors, their meanings, and best practices for handling them.
š Standard Error Response Format
All error responses follow this JSON structure:
{
"status": "error",
"error": {
"code": 400,
"message": "Invalid request parameters.",
"details": "The 'orderId' field is required."
}
}- status ā Indicates an error (
error) - error.code ā HTTP status code
- error.message ā Human-readable description of the error
- error.details ā Additional information for debugging (optional)
š” Common HTTP Errors & Status Codes
| Status Code | Meaning | Description |
|---|---|---|
| 400 | Bad Request | The request is malformed or missing required fields. |
| 401 | Unauthorized | The request lacks valid authentication credentials. |
| 403 | Forbidden | The user does not have permission to access this resource. |
| 404 | Not Found | The requested resource does not exist. |
| 409 | Conflict | The request conflicts with the current state of the resource. |
| 422 | Unprocessable Entity | The request was valid, but the server could not process it. |
| 429 | Too Many Requests | The client has exceeded the API rate limits. |
| 500 | Internal Server Error | A server-side error occurred. Try again later. |
| 504 | Gateway Timeout | The request took too long to process. Retry the request. |
ā³ Handling Rate Limits (429 Too Many Requests)
429 Too Many Requests)If you exceed the rate limit, the API returns:
{
"status": "error",
"error": {
"code": 429,
"message": "Rate limit exceeded. Try again after 30 seconds."
}
}š Retry Strategy: Exponential Backoff
To avoid hitting rate limits repeatedly, implement exponential backoff:
- Wait 1 second, retry.
- If it fails, wait 2 seconds, retry.
- If it still fails, wait 4 seconds, retry.
- Continue doubling wait time (e.g., 8s, 16s) up to 5 retries.
š„ Handling Server & Timeout Errors (500, 504)
500, 504)If a server-side error occurs (500 Internal Server Error, 504 Gateway Timeout), follow these best practices:
ā
Retry the request using exponential backoff.
ā
If retries fail multiple times, contact support.
š Troubleshooting & Support
If you encounter persistent issues:
ā
Check the error message and HTTP status code.
ā
Ensure your request follows the API specification.
ā
Refer to the API documentation for required fields.
ā
Contact support if issues persist.
š§ Support Email: [email protected]