The Community is hosting an End of Summer sweepstakes! Participants must complete tasks to earn tickets that will enter them with a chance to win a free year of Constant Contact and other great prizes!*
*No Purchase Necessary. For Official Rules, visit here. Constant Contact’s End of Summer 2020 Sweepstakes ends on October, 20, 2020 at 11:50 PM EST.

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

Highlighted
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
Highlighted
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
Highlighted
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à"

Highlighted
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

Developer Portal

View API documentation, code samples, get your API key.

Visit Page

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More
Featured