Constant contact api issue

Occasional Contributor

Constant contact api issue



I am using constant contact API ( with authorization type for my site URL: but we are getting this error for so many email ids:


Error Updating Contact

[error_key] => json.max.items.violation

[error_message] => #/email_addresses: 2 items were contained, but the maximum number of items allowed is 1.


I looked into the error and found that whenever an email id is already added in other lists i.e list1,list2 and we try to add it in some other list i.e list3.First we check for if email is already exist via API i.e


// check to see if a contact with the email addess already exists in the account

$response = $cc->getContactByEmail(ACCESS_TOKEN, ‘’);


If it exists we execute the script :

$action = "Updating Contact";

$contact = $response->results[0];


$contact->first_name = ‘first_name';

$contact->last_name = 'last_name';

$returnContact = $cc->updateContact(ACCESS_TOKEN, $contact, true);


I get the error in above code where we update the contact.


Please help us to resolve the above error ASAP.IT'S URGENT.



Satya prakash

Honored Contributor

Re: Constant contact api issue



I wanted to reach back out here and provide the information that I have provided via email as well. After researching this issue, it appears that a specific contact(and potentially some others) have some unusual data stored in their records which is causing our system to return multiple email addresses when only one should be returned. While we are investiating this, you could prevent this error by implementing code that forcefully limits the number of email addresses to 1.


Here is an example of how such code could work:

$contact->email_addresses = array_slice($contact->email_addresses, 0, 1); 


If you have  any questions, please feel free to reply here or to my email.



Elijah G.
API Support Engineer
Developer Portal

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

Visit Page

Register for our "Making Sense of Online Marketing for Retail" Webinar

Join us on Thursday, August 13th at 2pm ET for a free webinar where we'll discuss how to incorporate online marketing into your retail store.

Read More