cancel
Showing results for 
Search instead for 
Did you mean: 
Constant Contact wants to help you succeed! We’re celebrating our professional service programs on the Constant Contact Community this month and you have a chance to try one of the services for free! Learn more.

Adding new contact getting Invalid Byte Sequence in UTF-8 error

Occasional Contributor

Adding new contact getting Invalid Byte Sequence in UTF-8 error

We are working on implementing the new V3 version of your API.  When we push over a contact that has a special character in their name (in this case "Boglárka") we are receiving the "invalid byte sequence in utf-8" error.  I have code that converts the unicode to ISO-8859-1 but it still gives this error. Am I converting this string incorrectly?  I get the same issue when I add or update this contact.  Bulk import blows up the entire batch. 

Request Body:

{
"contact_id": null,
"email_address": {
"address": "hansoncolton_137@mailinator.com",
"permission_to_send": "implicit"
},
"first_name": "Boglárka",
"last_name": "Balassaa",
"job_title": "",
"company_name": "",
"create_source": "Account",
"update_source": "Account",
"phone_numbers": [],
"street_addresses": [{
"street": "",
"city": "",
"state": "",
"postal_code": null,
"country": "",
"kind": "work"
}
],
"list_memberships": ["91ef3366-4f41-11e9-bc63-d4ae52806b34", "6bbe73a8-4f3e-11e9-8fc2-d4ae5292c973", "6bd796b2-4f3e-11e9-b034-d4ae528ed502"]
}

Response:

[
{
"error_key": "contacts.api.bad_request",
"error_message": "invalid byte sequence in UTF-8"
}]
3 REPLIES 3
Moderator

Re: Adding new contact getting Invalid Byte Sequence in UTF-8 error

Hello @IntegrationT4,

 

Thank you for reaching out to Constant Contact's API Support.

 

Unicode or 16-bit character sets are not supported in Constant Contact. You will want to use an 8-bit character set, or you can try an HTML entity.


Regards,
Jimmy D.
Tier II API Support Engineer
Occasional Participant

Re: Adding new contact getting Invalid Byte Sequence in UTF-8 error

I'm trying to set the name of a Contact which is "Beà".

I have tried leaving it UTF-8 - I get the Invalid character error.

I tried setting the name to "Beà" (à is the HTML entity for "à") and the resulting saved name is the explicit characters "BEà".

There is no equivalent ISO-8859-1 encoding for this character.

Is there a way to get this character into the Constant Contact Name field?\

PUT (update) JSON : 

{"email_address":{"address":"xxx@aol.com"},"first_name":"Beà","update_source":"Account"}

Resulting name field for GET contact:

"first_name": "Beà"

Moderator

Re: Adding new contact getting Invalid Byte Sequence in UTF-8 error

Hello,

 

I was able to add this character to a name field in the Constant Contact website UI, though it does not seem to be supported properly with our V3 API. I have brought this to our development team to review a possible enhancement.


Please let me know if you have any other questions!

 

Regards,
David B.
Tier II API Support Engineer