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 when create a new contact

Frequent Visitor

400 error when create a new contact

I'm not able to figure out what I'm doing wrong.  I'm getting a 400 error when posting to:*****/contacts


Here is my xml:


<entry xmlns="">  <title type="text"></title>  <updated>2011-08-25T01:21:06.407Z</updated>  <author></author>  <id>data:,none</id>  <summary type="text">Contact</summary>  <content type="application/vnd.ctct+xml">    <Contact xmlns="">      <EmailAddress></EmailAddress>      <OptInSource>ACTION_BY_CUSTOMER</OptInSource>      <ContactLists>        <ContactList id="***/lists/1" />      </ContactLists>    </Contact>  </content></entry>


List 1 is a valid list.  I get a 400 error back from the server.  Is there a way to get more information on what is causing the error?




Re: 400 error when create a new contact


It looks like the problem is with how your XML is formatted.  When I changed the spacing so that each node is on a separate line, it worked for me.  I have included an example below:

<entry xmlns=""> 
<title type="text"></title>
<summary type="text">Contact</summary>
<content type="application/vnd.ctct+xml">
<Contact xmlns="">
<ContactList id="***/lists/1"/>     


I hope this helps.  Please let me know if I can be of further assistance.

Matt R.
Support Engineer, 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