Skip to content

Common Errors

Reserhub Data Lake prioritizes the quality and integrity of your data. For this reason, our API services enforce rigorous authentication and validation controls for incoming information. During integration, errors may arise due to these strict requirements. Below is a general overview of the implemented protocols. For specific details and practical examples, refer to their corresponding sections.

Client Errors (4xx)

These errors typically indicate a problem with the client’s request.


400 - Bad Request

  • HTTP Status: 400 Bad Request
  • Description: The server could not understand the request due to invalid syntax. This often means the JSON body is malformed.
  • Possible Causes: Syntax errors in the JSON payload like missing commas, mismatched brackets ({}) or braces ([]), unescaped quotes within strings.
  • Solution: Carefully check the syntax of your JSON request body. Use a JSON validator or linter to identify syntax errors before sending the request.

401 - Unauthorized

  • HTTP Status: 401 Unauthorized
  • Description: The request lacks valid authentication credentials for the target resource, typically caused by an invalid Authorization or Origin header.
  • Possible Causes: The Authorization header is missing, the bearer token provided is invalid or expired, or the Origin header is invalid.
  • Solution: Ensure you are including a valid Authorization header with the correct Bearer <your_token> format. Verify that your API token is correct and has not expired. Also, ensure a valid Origin header is being sent.

422 - Unprocessable Entity

  • HTTP Status: 422 Unprocessable Entity
  • Description: This occurs when the request syntax is correct, but the server cannot process the contained instructions due to semantic errors in the data. The sections below detail common validation error types that trigger this response.
  • Possible Causes: Providing data that fails validation checks (e.g., incorrect type, missing required field, invalid format).
  • Solution: Check the error response body for details on which fields failed validation and the specific error type. Correct the data according to the API specification and the details provided for each error type below.

Error Types

MISSING_FIELD

  • Description: Indicates that a required field was not included in the request payload.
  • Possible Causes: Omitting a mandatory field defined in the API specification for the specific endpoint.
  • Solution: Review the API documentation for the endpoint being called. Ensure all required fields are present in your request payload with appropriate values. See the Required Data Guide for more details.
  • Details: Required Data Guide

TYPE_MISMATCH

  • Description: The data type of a value provided in the request does not match the expected data type for that field.
  • Possible Causes: Sending a boolean value for a field expecting a string, sending an array for a field expecting an integer, etc.
  • Solution: Check the API documentation for the correct data type expected for the field indicated in the error. The error response often includes expected and received fields for clarification. See the Invalid Data Type Guide for more details.
  • Details: Invalid Data Type Guide

FORMAT_MISMATCH

  • Description: The data provided for a field is of the correct basic type (e.g., string) but does not conform to the specific format required.
  • Possible Causes: Providing a date string that is not in the ISO 8601 format, providing an invalid email address structure.
  • Solution: Consult the API documentation for the specific format requirements of the field. Reformat the data accordingly. See the Data Format Guide for more details.
  • Details: Data Format Guide

MIN_ITEMS

  • Description: An array field in the request payload does not contain the minimum required number of items.
  • Possible Causes: Sending an empty array ([]) for a field that requires at least one element (e.g., the trips array).
  • Solution: Ensure the array specified in the error message contains at least the minimum number of items required (often one). See the Minimum Items Guide for more details.
  • Details: Minimum Items Guide

UNEXPECTED_FIELD

  • Description: The request payload contains a field that is not recognized or allowed for the target endpoint or object structure.
  • Possible Causes: Including a field that is not part of the API specification for the endpoint, misspelling a field name.
  • Solution: Review the API documentation for the endpoint being called. Remove any fields from your request payload that are not defined in the specification. Check for typos in field names. See the Unexpected Data Guide for more details.
  • Details: Unexpected Data Guide

Conclusion

Effectively handling errors is crucial for a good user experience. Make sure to implement proper error handling in your application to respond to these error codes effectively.