You need to sign in to do that
Don't have an account?
HUGE UTF-8 REST API ERROR 400
Hi friends,
im trying to upload some leads using Java and the REST API feature, but after all day fighting against the Charset UTF-8 and ISO-8859-1 , i found out that when you try to upload a UTF-8 encoded json object with a special character in the Company field, it responds you with a 400 - bad request.
You can have special characters enconded in UTF-8 in any other field as FirstName, LastName, Street, City, Country, etc. this works and the lead will be uploaded, but if you have it in Company it will crash.
Does any body knows why is this ? It seems as a bug, or is something i need to configure in the ORG ?
thanks for watching
cheers
StringEntity body = new StringEntity(contact.toString(1), "UTF-8");
All Answers
{
"LastName" : "Express Logistics and Transport",
"Company" :"@@@@@@@%%%"
}
Service URI:/services/data/v26.0/sobjects/Lead/
I used the above REST API and it works perfectly to upload lead .
Can you please post the Service URL you are trying
We are seeing a smilar issue trying to save a User/Contact name that has accented characters like á, é etc.
We are using the REST Api to create/update Users/Contacts.
We set the charset to UTF-8 when doing httpPost or httpPatch such :
HttpPost httpPost = new HttpPost(host + url);
httpPost.setHeader("Content-Type", "application/json;charset=UTF-8");
httpPost.setEntity(new StringEntity(jsonRequest, "UTF-8"));
We do not get an error, the objects are created/updated, but the accented characters appear funny when viewing in SF.
Please let us know if this is a known issue, or we are missing something ?
Thanks!
StringEntity body = new StringEntity(contact.toString(1), "UTF-8");