I've run into an error adding a new lead with the API. Here's the response:
{
"status":400,
"message":"Invalid request data",
"error_name":"invalid_request_data",
"error_message":"A validation error has occurred",
"errors":{"custom_fields":{"custom_field":"value_not_suitable"}}
}
The lead includes a value for a custom field that includes an ampersand character. When the data converted to JSON and serialized, it encodes the ampersand character as unicode, so the custom field looks like this:
{"custom_field":{"id":"53c6b937eb8997129100000d"},"value":"CAD \u0026 Schematic"}
When I changed the value of the field to something that didn't include an ampersand, I was able to create the lead and change it in the UI. That works for now, but it's not really sustainable. This is a valid JSON encoding, so I think the server should accept it as valid.
Previous requests with the same value with the same encoding were successful, so I suspect this was a regression introduced by the latest API updates.
Thanks,
Jason
Hi Jason, really sorry you came up against this issue.
We changed how we were sanatizing the input and I guess we were a bit too strict!
I've made some updates so this issue should now be fixed for you.
When you get a chance, could you verify that it is working again as expected?
Looks good. Thanks for addressing this so quickly!