All replies have an application / json content type and follow generally accepted status codes:

Status Description
200 OK
401 Wrong API key
403 Access denied
404 Not Found
405 Method Not Allowed
422 Unprocessable Entity
500 Internal Server Error

Successful response data is always in the data key, for example:

{
    "data": {
        "id": 123,
        "name": "Example",
        "active": true
    }
}

Data arrays can be returned per page:

{
    "data": [],
    "links": {
        "first": "https://geniusdigital.org/api/example?page=1",
        "last": "https://geniusdigital.org/api/example?page=5",
        "prev": "https://geniusdigital.org/api/example?page=2",
        "next": "https://geniusdigital.org/api/example?page=4"
    },
    "meta": {
        "current_page": 3,
        "from": 31,
        "last_page": 5,
        "path": "https://geniusdigital.org/api/example",
        "per_page": 15,
        "to": 45,
        "total": 75
    }
}

In case of an error with the code 4** the message is placed in the key message, for example:

{
    "message": "Unauthenticated."
}

Example response with code 422 - invalid request:

{
    "message": "The given data was invalid.",
    "errors": {
        "pair": [
            "The pair field is required."
        ]
    }
}

back next