Hi team!
Validation error of the Contact API is a bit tough to use.
When an email in a request is invalid for the Contact API, the error is returned like below format.
{
"status": "error",
"message": "Property values were not valid: [{\"isValid\":false,\"message\":\"Email address bcooper@gmail.con is invalid\",\"error\":\"INVALID_EMAIL\",\"name\":\"email\"}]",
"correlationId": "XXX",
"category": "VALIDATION_ERROR"
}
As you can see, the details of the errors are contained in the message body, which makes it difficult for applications using the API to parse it.
Is it possible to make them structurally separate from the message so that the response can be parsed as JSON and error message is usable as it is.
You can reproduce the response by sending below payload to Contact create API
{
"company": "Biglytics",
"email": "bcooper@gmail.con",
"firstname": "Bryan",
"lastname": "Cooper",
"phone": "(877) 929-0687"
}
Also, please let us know if there is anything we can do for you at this point, such as changing options in the request.