When interacting with Trully APIs, you can expect responses to follow a consistent JSON format. Here's an example of a typical API response:

 {  
    "data": {  
        // The data body goes here.  
    },  
    "version": "v1.0.0",  
    "status": "ok",  
    "status_code": 200,  
    "request_date": "2023-11-24T14:20:50+0000",  
    "request": {  
        // Request data goes here.  
     }  
}

HTTP Status Codes

Trully APIs use standard HTTP status codes to communicate the outcome of API requests. Here are some common HTTP status codes you may encounter when interacting with our APIs:

  • 200 OK: Indicates a successful API request. The request was processed without errors, and the response contains the expected data.
  • 400 Bad Request: Denotes an invalid request. This status code is typically returned due to missing or incorrect parameters in the request. Review the error message in the response for details.
  • 401 Unauthorized: Occurs when authentication credentials are missing or invalid. Ensure that you provide valid credentials to access protected resources.
  • 403 Forbidden: Indicates that the authenticated user does not have permission to access the requested resource. Check your permissions and authentication credentials.
  • 404 Not Found: Signifies that the requested resource could not be found on the server. Ensure that you are using the correct endpoints and resource identifiers.
  • 429 Too Many Requests: Occurs when you've exceeded the rate limits for API requests. Implement retry strategies with exponential backoff to handle this situation.
  • 5xx Server Errors: Denote internal server errors. While these should be rare, it's essential to handle them gracefully and report them to the API provider for investigation.

Understanding and appropriately handling these HTTP status codes is crucial for effectively working with Trully APIs. It ensures that your applications can respond to different scenarios and provide a smooth user experience.