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 adding a new contact

New Member

400 adding a new contact

Here is my xml for adding:

<entry xmlns="">


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


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

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

        <Contact xmlns="">Customer document






















                <ContactList id=""/>





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?

Occasional Advisor

RE: Error 400



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="">

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




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

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

    <Contact xmlns="">






        <ContactList id=""/>





Andrew T

Support Engineer, Constant Contact

New Member

OK, another problem.

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.


Re: OK, another problem.

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

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