Errors
API Errors
Overview
When interacting with the OCUS API, errors may occur due to invalid requests, authentication issues, or system failures. This document outlines the common error responses, their meanings, and how to handle them effectively.
Common Error Codes
| Code | HTTP Status | Description |
|---|---|---|
invalid_request | 400 | The request contains missing or invalid parameters. |
unauthorized | 401 | Authentication is missing or invalid. |
forbidden | 403 | The client does not have permission to access this resource. |
not_found | 404 | The requested resource does not exist. |
method_not_allowed | 405 | The HTTP method used is not supported for this endpoint. |
conflict | 409 | The request conflicts with the current state of the resource. |
rate_limited | 429 | Too many requests were made in a short period. |
server_error | 500 | An internal server error occurred. |
service_unavailable | 503 | The API is temporarily unavailable. |
Handling Errors
Client-Side Errors (4xx)
Errors in the 400-499 range indicate issues with the request. Clients should:
- Verify request parameters and authentication credentials.
- Check permissions before making a request.
- Implement proper validation before sending requests.
Server-Side Errors (5xx)
Errors in the 500-599 range indicate server-side issues. Clients should:
- Implement retry logic with exponential backoff for temporary failures.
- Log errors and report recurring issues to OCUS support.
Error Logging and Debugging
- Enable API Logging: Track failed requests and responses for troubleshooting.
- Monitor API Usage: Avoid exceeding rate limits.
- Check Response Headers: Some errors may include additional debugging information in the response headers.
By handling errors correctly, clients can improve the reliability and robustness of their integration with the OCUS API.
Updated 10 months ago
