Last updated

Error Handling

Effective error handling ensures smooth integration and provides clarity when issues arise. Below is a list of common HTTP status codes, their descriptions, and guidance on resolving them:

Error CodeSlugTypeMeaning
400bad_requestBad RequestThe request is malformed or contains invalid parameters.
401unauthorizedUnauthorizedInvalid or missing API key. Ensure your authentication credentials are correct.
403forbiddenForbiddenYou do not have the necessary permissions to access the requested resource.
404not_foundNot FoundThe specified resource or URL path could not be found.
405method_not_allowedMethod Not AllowedThe HTTP method used is not valid for this endpoint.
406not_acceptableNot AcceptableThe requested response format is not supported.
410goneGoneThe requested resource has been removed and is no longer available.
422validation_failedUnprocessable EntityThe request contains invalid data or violates input validation rules.
429too_many_requestsToo Many RequestsYou have exceeded the rate limit. Slow down your requests.
500server_errorInternal Server ErrorAn unexpected issue occurred on our server. Please try again later.
503service_unavailableService UnavailableThe server is temporarily offline for maintenance. Please try again later.

In the event of a 422 error, the error object will include the field name as a property. This property will contain an array of error messages as its value. Here's an example:


// Response Validation Failed
{
    "status": false,
    "message": "Forbidden parameter! (and 2 more errors)",
    "errors": {
        "parameter": [
            "Forbidden parameter!"
        ]
    }
}

// Response Authentication Failed
{
    "status": false,
    "message": "Token is expired."
}