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.

Opting Back In

Occasional Participant

Opting Back In

I am trying to create a form to opt a customer back into our list.   Using the same code, I can update a user and remove a user from a list without any issues.

I successfully get their user information.  I delete the Status node.  I add the OptInSource Node to the Contact node  I also make sure that ContactLists and ContactList nodes are present.  When I use the XMLDom to add the nodes, it does add an xmlns attribute to the new nodes.  I am not getting any errors, but the user is still in the do not mail lsit.

Here is the xml after I make my modifications.  I am using PUT and sending it to ../contacts/{ThecorrectUserId}

Any ideas on the problem?

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

<link href="/ws/customers/BeckerHolding/contacts/7" rel="edit">

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

<contact xmlns="http://ws.constantcontact.com/ns/1.0/" id="http://api.constantcontact.com/ws/customers/BeckerHolding/contacts/7">
<name>test person</name>




<optinsource xmlns="">ACTION_BY_CONTACT</optinsource><contactlists xmlns=""><contactlist id="http://api.constantcontact.com/ws/customers/BeckerHolding/lists/1"></contactlist></contactlists>


<link href="contacts">
<link href="contacts" rel="self">






I did some testing and it does appear the issue you are having is with the xlmns="" on both the OptInSource and ContactLists nodes.  If you are able to remove these it should work.  Also please note that these nodes are case sensitive, so optinsource will not work, it must be OptInSource.


Benjamin Soder
NOC Analyst
Constant Contact
Developer Portal

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

Visit Page