BadRequest (400) Failed Status
The response content contains error message. The error data can be any one of the following types.
- Single object type
-
An array of ResolvedError type object. If the response contains a custom header named "X-Resolved-Errors" then it means the response content contains an array of ResolvedError.
The Message and ValidationMessages properties of ResolvedError object, will be useful to 3rd application. ResolvedError may have null validation messages. The array of ResolvedError contains the original error (the most inner exception) at the last position. -
A HttpError type of object having ModelState errors while parsing the request. If the response contains a custom header named "X-ModelState-Errors" then it means the response content contains ModelState errors.
The Message and properties of ModelState object, will be useful to 3rd application.
Response Formats for the returned data of single object type
application/json, text/json
Sample:
{
"message": "sample string bad request error message."
}
application/xml, text/xml
Sample:
<Error> <Message>sample string bad request error message.</Message> </Error>
Response Formats for the returned data of an array of ResolvedError type object without validation messages
application/json, text/json
Sample:
[
{
"ExceptionID": 3404,
"Number": 5041,
"Message": "Customer Add Failed",
"Info": "Customer",
"Type": "System.Exception",
"Source": "Abacus.BusinessRules",
"DateTime": "2019-06-04T21:08:40.5742399-04:00",
"ValidationMessages": null
},
{
"ExceptionID": 3405,
"Number": 0,
"Message": "Value cannot be null.\r\nParameter name: source",
"Info": "",
"Type": "System.ArgumentNullException",
"Source": "System.Core",
"DateTime": "2019-06-04T21:08:40.5742399-04:00",
"ValidationMessages": null
}
]
application/xml, text/xml
Sample:
<ArrayOfResolvedError xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ResolvedError>
<ExceptionID>3404</ExceptionID>
<Number>5041</Number>
<Message>Customer Add Failed</Message>
<Info>Customer</Info>
<Type>System.Exception</Type>
<Source>Abacus.BusinessRules</Source>
<DateTime>2019-06-04T21:08:40.5742399-04:00</DateTime>
</ResolvedError>
<ResolvedError>
<ExceptionID>3405</ExceptionID>
<Number>0</Number>
<Message>Value cannot be null.
Parameter name: source</Message>
<Info />
<Type>System.ArgumentNullException</Type>
<Source>System.Core</Source>
<DateTime>2019-06-04T21:08:40.5742399-04:00</DateTime>
</ResolvedError>
</ArrayOfResolvedError>
Response Formats for the returned data of an array of ResolvedError type object with validation messages
application/json, text/json
Sample:
[
{
"ExceptionID": 3378,
"Number": 0,
"Message": "Error adding Loan Application.",
"Info": "",
"Type": "System.Exception",
"Source": "AbacusAPI",
"DateTime": "2019-06-04T21:08:40.5932402-04:00",
"ValidationMessages": null
},
{
"ExceptionID": 3379,
"Number": 4137,
"Message": "Analysis validation errors.",
"Info": "Analysis Links",
"Type": "Abacus.ValidationException",
"Source": "Abacus.BusinessRules",
"DateTime": "2019-06-04T21:08:40.5932402-04:00",
"ValidationMessages": [
{
"FieldName": "Age",
"Message": "Outside product age limits."
}
]
}
]
application/xml, text/xml
Sample:
<ArrayOfResolvedError xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ResolvedError>
<ExceptionID>3378</ExceptionID>
<Number>0</Number>
<Message>Error adding Loan Application.</Message>
<Info />
<Type>System.Exception</Type>
<Source>AbacusAPI</Source>
<DateTime>2019-06-04T21:08:40.5932402-04:00</DateTime>
</ResolvedError>
<ResolvedError>
<ExceptionID>3379</ExceptionID>
<Number>4137</Number>
<Message>Analysis validation errors.</Message>
<Info>Analysis Links</Info>
<Type>Abacus.ValidationException</Type>
<Source>Abacus.BusinessRules</Source>
<DateTime>2019-06-04T21:08:40.5932402-04:00</DateTime>
<ValidationMessages>
<ValidationMessage>
<FieldName>Age</FieldName>
<Message>Outside product age limits.</Message>
</ValidationMessage>
</ValidationMessages>
</ResolvedError>
</ArrayOfResolvedError>
Response Formats for the returned data as a HttpError type of object having ModelState errors while parsing the request.
application/json, text/json
Sample:
{
"Message": "The request is invalid.",
"ModelState": {
"allowCustomers": [
"The value '1' is not valid for AllowCustomers."
],
"active": [
"The value '1' is not valid for Active."
]
}
}
application/xml, text/xml
Sample:
<Error>
<Message>The request is invalid.</Message>
<ModelState>
<allowCustomers>The value '1' is not valid for AllowCustomers.</allowCustomers>
<active>The value '1' is not valid for Active.</active>
</ModelState>
</Error>