We all started somewhere! Share your experience on the Get Advice: Let's Get Started Sweepstakes thread and be entered to win a $100 credit on your Constant Contact account.

400 adding a new contact

Occasional Participant

400 adding a new contact

Here is my xml for adding:

<entry xmlns="http://www.w3.org/2005/Atom">


    <author><name>CTCT Samples</name></author>


    <summary type="text">Customer document</summary>

    <content type="application/vnd.ctct+xml">

        <Contact xmlns="http://ws.constantcontact.com/ns/1.0/">Customer document






















                <ContactList id="http://api.constantcontact.com/ws/customers/user@name.com/lists/1"/>





I keep getting a 400 error. I am getting the list id from the API as well so I know that is working. Any ideas?

Regular Participant



After inspecting your XML, I have found multiple issues with your XML that is causing this error.


To correct these errors, please change your ID node from <id>2</id> to <id>data:,none</id>. In addition, the contact details fields are case sensitive, meaning <emailaddress> must be changed to <EmailAddress> in order to function correctly.


Lastly, when creating a contact, not all fields are required to be sent. Although sending additional empty fields will not cause any errors, they are not required to be included in your XML for successful contact creation.


Please use the following XML as a reference for your future contact creations:

<entry xmlns="http://www.w3.org/2005/Atom">

  <title type="text"> </title>




  <summary type="text">Contact</summary>

  <content type="application/vnd.ctct+xml">

    <Contact xmlns="http://ws.constantcontact.com/ns/1.0/">






        <ContactList id="http://api.constantcontact.com/ws/customers/user@name.com/lists/1"/>





Andrew T

Support Engineer, Constant Contact

Occasional Participant

Yes I figured those out. I do not know why my xml was not camel case as the php is correct. I ran it again and it was fine. I also have extra fields because I intend on using them but have not filled them in for initial tests.

I figured out how to remove contacts from the list(not moving to the 'Do Not Mail' list). But when I try to add that same contact again it cannot add because they allready exist. Any ideas? Thanks.


Once an email address has been added to Constant Contact, they are never fully removed. If you have removed the contact from all contact lists and wish to add them back to other lists, you must update the contact that already exists. Typically I would recommend this type of flow for this.


1. Search for contact by email address


2. If the contact exists, obtain their id from the XML returned from the search and use this to retrieve the full contact details


3. Update the contact to include the <ContactList> that you wish for the contact to be subscribed to. You can find more information on this process in Adding or Removing a Contact from a List.


This will take the contact out of 'removed' status and place them in whatever list(s) you chose.

David J

Developer Portal

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

Visit Page