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.

API: Problem: Upload Contacts Bulk Activity containing a comma

Highlighted
Occasional Contributor

API: Problem: Upload Contacts Bulk Activity containing a comma

Hello,

 

I am facing the following issue.

When the JSON payload contains a comma in the value of a custom field, the imported contact is not correct.

For example:

The import of the following

 

Custom Field 1: test, test

Custom Field 2: value 2

Custom Field 3: value 3

 

Has the following result in Constant Contact:

Custom Field 1: test

Custom Field 2: test

Custom Field 3: value 2

Custom Field 4: value 3

 

I believe this is not by design, but perhaps I need to escape the comma someway? However I do not understand this, because the field's value is wrapped between double quotes in the JSON string.

 

Can anyone shed some light on this?

3 REPLIES 3
Highlighted
Regular Advisor

Re: API: Problem: Upload Contacts Bulk Activity containing a comma

Hello,

 

Thanks for posting.  What your experiencing definitely seems like a defect in the processing of the custom fields.  Would you mind sending me a PM with the details of the API call?  Thanks.

 

Andrew B.

Constant Contact

API Support

Highlighted
Occasional Contributor

Re: API: Problem: Upload Contacts Bulk Activity containing a comma

Thanks for your reply Andrew. I have sent you a JSON string via PM.

Highlighted
Regular Advisor

Re: API: Problem: Upload Contacts Bulk Activity containing a comma

Here's an update.  We have been able to reproduce the problem and it is logged as a defect to be fixed.  We were also able to determine a workaround until the fix is live.  If there is a custom field with a comma in the value, you can wrap the field in escaped double quotes to ensure correct processing. 

 

So this:

 

{
     "name":"Custom Field 1",

     "value":"test, test"

}

 

Becomes this:

 

{
     "name":"Custom Field 1",

     "value":"\"test, test\""

}

 

I'll provide another update once I know when the fix should be released.

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