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.

400 Error on adding contact to list

Highlighted
Occasional Advisor

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)
https://api.constantcontact.com/ws/customers/j{username]/contacts/#.

 

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>
<updated>2011-12-14T15:14:08+01:00</updated>
<author/>
<id>http://api.constantcontact.com/ws/customers/{username}/contacts/#</id>
<content type="application/vnd.ctct+xml">
<Contact xmlns="http://ws.constantcontact.com/ns/1.0/" id="http://api.constantcontact.com/ws/customers/{username}/contacts/#">
<EmailAddress>email@email.com</EmailAddress>
<FirstName>John</FirstName>
<LastName>Doe</LastName>
<OptInSource>ACTION_BY_CUSTOMER</OptInSource>
<ContactLists>
<ContactList id="http://api.constantcontact.com/ws/customers/{username}/lists/{list_id}"/>
</ContactLists>
</Contact>
</content>
</entry>

 

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

 

 

5 REPLIES 5
Highlighted
Employee

Re: 400 Error on adding contact to list

Hey,

 

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
Highlighted
Occasional Advisor

Re: 400 Error on adding contact to list

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

Highlighted
Employee

Re: 400 Error on adding contact to list

Hey,

 

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

Ryan Davis
Quality Engineer
Highlighted
Occasional Advisor

Re: 400 Error on adding contact to list

any luck?

Highlighted
Moderator

Re: 400 Error on adding contact to list

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

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