Finvera’s API provides clear and structured error responses to help developers diagnose and resolve issues efficiently. Below is a breakdown of common errors, their meanings, and best practices for handling them.

Error Response Format

All error responses follow a standardized JSON format:

{
  "error": {
    "code": 400,
    "message": "Invalid request parameters",
    "details": "The 'symbol' parameter is required"
  }
}

Common Error Codes & Their Causes

HTTP Status CodeError TypeDescription
400 Bad RequestInvalid ParametersThe request contains malformed or missing parameters.
401 UnauthorizedInvalid API KeyAuthentication is missing or incorrect. Ensure you include the Bearer token.
403 ForbiddenInsufficient PermissionsThe request is valid but the API key does not have access to the requested resource.
404 Not FoundResource Not FoundThe requested endpoint or data does not exist.
429 Too Many RequestsRate Limit ExceededThe request limit has been reached; slow down requests or upgrade your plan.
500 Internal Server ErrorUnexpected ErrorA server-side issue occurred; retry later or contact support.

Best Practices for Handling Errors

  1. Check Error Messages: Every error response includes a descriptive message to help pinpoint the issue.
  2. Implement Retries with Backoff: Use exponential backoff (e.g., 1s, 2s, 4s) when handling transient errors like 429 Too Many Requests or 500 Internal Server Error.
  3. Validate Requests Before Sending: Ensure required parameters are included and correctly formatted.
  4. Monitor Rate Limits: Avoid hitting rate limits by keeping track of API usage and applying caching strategies.
  5. Graceful Degradation: If an error occurs, provide fallback behavior (e.g., displaying cached data instead of failing completely).
  6. Log Errors: Capture and analyze errors to improve request handling and debug failures efficiently.

By following these guidelines, you can ensure smooth and resilient API integrations. For persistent issues, contact AltData Support for assistance.