Common API Error Responses

This section will describe some of the common error responses that you will come across while using the API

400 - Bad Request

{
    "error": {
        "status": "400",
        "message": "Already liked"
    }
}

This error can occur for a variety of different reasons. You can look at the message key to understand what caused it. Some examples in our APIs would be:

403 - Forbidden

{
    "error": {
        "status": 403,
        "message": "Unauthorized"
    }
}

This error can occur when a user accesses an endpoint that they are not authorized to access. For example, an ESS user trying to access an Admin endpoint.

404 - Record Not Found

{
    "error": {
        "status": "404",
        "message": "Record Not Found"
    }
}

This error typically occurs for getOne endpoints. If you get this error then it means that the record you requested does not exist in the system.

422 - Invalid Parameter

{
    "error": {
        "status": "422",
        "message": "Invalid Parameter",
        "data": {
            "invalidParamKeys": [
                "paramKeyName"
            ]
        }
    }
}

This error occurs when a parameter is given a value that it cannot take (for example putting a string when the parameter requires a number) or additional parameters are incorrectly added. The parameters that cause the error will be listed in the invalidParamKeys array.