Response Conventions

HTTP Status

Upon successful request, the Splio Customer Platform API will serve a response bearing the most appropriate of the following standard HTTP status codes:

HTTP Status CodeHTTP Status Name
200OK
201Created
204No Content
207Multi-Status

Upon unsuccessful request, the Splio Customer Platform API will serve a response bearing the most appropriate of the following standard HTTP error status codes:

HTTP Status CodeHTTP Status Name
400Bad Request
401Not Authenticated
405Method Not Allowed
502Bad Gateway
503Unavailable

Please refer to RFC 7231 for details.

Detail on errors

In case of an error, the Splio Customer Platform API will respond with an appropriate HTTP code, along with a JSON payload describing the error.

Authentication (401)

In case of an invalid/missing authentication token, only the 401 response code will be provided, with a generic response "Authentication failed.”

Method not allowed (405)

In case of an unsupported method (ex: PUT instead of POST) on a valid endpoint, only the 405 response code will be provided, with a generic response "Method Not Allowed."

Malformatted json (400)

In case of an malformatted json in the query, the following response will be returned

{
    "status": 400,
    "errors": [
        {
            "error_key": "payload",
            "error": "invalid_json",
            "error_description": "Json payload is invalid, verify its syntax."
        }
    ]
}

Other errors

For other errors, that might depend on the endpoint/data provided, the error response body will be similar and provide details on the issue - here are two examples:

{
    "status": 400,
    "errors": [
        {
            "error_key": "custom_fields",
            "error": "wrong_type",
            "error_description": "Custom field with id 5 and name Date_de_test must be of type date."
        }
    ]
}
{
    "status": 400,
    "errors": [
        {
            "error_key": "email",
            "error": "wrong_email",
            "error_description": "The email given should have the right format"
        }
    ]
}