400 Error on adding contact to list

Regular Participant

400 Error on adding contact to list

I have code that runs nightly to create campains and schedule them. This code has been running for a good four to give months and all of a sudden last wednesday (december 7, 2011) I start getting random 400 errors when assigning a contact to a contact list I just created. I've tried all sorts of the combination of xml and modeled to the api docs exactly.


I am doing an http put request to (i replaced username and the number for privacy)


here is the xml that is being sent.


<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom">
<title type="text">Contact: email@email.com</title>
<content type="application/vnd.ctct+xml">
<Contact xmlns="http://ws.constantcontact.com/ns/1.0/" id="http://api.constantcontact.com/ws/customers/{username}/contacts/#">
<ContactList id="http://api.constantcontact.com/ws/customers/{username}/lists/{list_id}"/>


Sometimes this xml return a 204 and all is good and sometimes it returns a 400. it seems completely random and happens 50 to 60% (sometimes more) percent of the time.


At this point I don't see why this is happening. My automated code ran flawlessly for months and now I'm getting 400's. I could really use some help.


Thank you






The 400 error could be a number of different things.  It could be that the List ID is not bet set correctly or the contact creation is trying to happen before the list id has been recorded.  The other issue could be that you are trying to put a contact that does not exist.  The other area could be if someone has unsubscribed and your doing a PUT which would not allow you to move them into a the list.  We would need to see the code to get a better understanding of what the 400 error could be and the exact XML that is being passed in.  Please PM me with the exact XML or send an email to webservices@constantcontact.com.

Ryan Davis
Quality Engineer
Regular Participant

Ryan I sent you some time ago the exact xml so you could check the logs and you said it could take some time and it's been close to two weeks now. I PM'ed you but have received no response. Have you been able to find any information?


Thank you



We are currently looking intot he issue.  I apologize for the wait.

Ryan Davis
Quality Engineer
Regular Participant

any luck?

When you're running the requests, can you confirm if any of the following conditions exist?


Contacts are in "Confirmed" or "Awaiting Confirmation" state

Email Addresses are multi-case, such as having all caps or some caps


Or can you possibly send a list of some sample email addresses that are experiencing the sporadic 400 errors and the username for the account to me in a private message on the forums?  I am aware of a defect that were are working to fix in a coming release that could be the cause of this but I'd like to confirm it with some data before I say that's your cause.

Dave Berard
Senior Product Manager, Constant Contact
Developer Portal

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

Visit Page