General API Features
Security
The API is secured with a key, which can be requested from your Aventus Account Manager. This must be provided as a header with every request .
There will be a different API key per environment.
Header Name | Head value |
---|---|
avt-api-key | Key, as provided by Aventus |
Response Envelope
{
"data":{},
"error":-1,
"error_description":null,
"successful":true,
"validationErrors": []
}
{
"data":{},
"error":1006,
"error_description":"Validation failed",
"successful":false,
"validationErrors": [{
"message": "A previous address must be provided.",
"propertyIdentifier": "NewBusinessRequestType.Applicant.Customer"
}]
}
All API responses, including errors, shall be wrapped with the following response envelope unless otherwise stated.
Key | DataType | Description |
---|---|---|
data | object | The response data |
error | int | The error code, if the request was unsuccessful. For a successful response the error will always be -1 |
error_description | string | Human-readable description of the error. |
successful | boolean | true if a successful request, otherwise false . |
validationErrors | ValidationError Array | Array of validations (if any) |
Errors
The API returns standard HTTP status codes.
Validation Errors
Where the error is a result of a validation exception, the response will provide additional breakdown information for each error, and a field reference where possible.
Field | Description |
---|---|
message | Human-readable description of the validation error. |
propertyIdentifier | Where the input validation was the result of an error in a single field, this will be path to the input. |
Additional Errors from BNP
Where BNP return additional errors in their envelope, these will be passed back to the caller, with the Aventus Error specifying that there has been an external system error.
{
"data": {
"newBusinessResponseType": {
"brokerReference": null,
"accountNumber": null,
"decision": 5,
"pdf": "",
"responseStatus": 2
},
"errors": [
{
"code": 1079,
"description": "duplicate combination of client code / shop code / broker reference. Provide different broker reference"
}
]
},
"validationErrors": null,
"error": 1033,
"error_description": "External system error",
"successful": false
}
Details on BNP error codes can be found in their integration documentation.
Updated over 2 years ago