Responses

This page will explain the data returned in each request, as well as how errors are returned in the response.

Every response will include an error flag and a HTTP response code (code 200 means a request with no errores, code 400 means a request with validation errors and code 500 means a request with internal / critical errors.


Successful response (200)

Results

Column Description
error Error flag.
results Request's results.
0 HTTP response code.

Example

Response (JSON)
{
    "error": false,
    "results": [],
    "0": 200
}

Failed response (400)

Results

Column Description
error Error flag.
errors List of validation errores.
0 HTTP response code.

Example

Response (JSON)
{
    "error": true,
    "errors": {
        "id": [
            "The selected id is invalid."
        ],
        "name": [
            "The name must be at least 2 characters."
        ],
        "limit": [
            "The limit must be an integer."
        ]
    },
    "0": 400
}

Failed critical response (500)

Results

Column Description
error Error flag.
exception If a critical error occures, a code exception will be included in the response, we recommend to contact us with this information if this ever happens.
0 HTTP response code.

Example

Response (JSON)
{
    "error": true,
    "errors": {
        "exception": {
            "code": 0,
            "message": "Internal error example",
            "line": 49,
            "trace": [],
            "file": "file.php"
        }
    },
    "0": 500
}