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.

Re-adding contact to a list

Highlighted
Occasional Contributor

Re-adding contact to a list

Hi, I'm running some tests on my code and have come across a strange scenario.

 

1) Existing contact is added to a list using the Update process through the API

 

2) Through the CC web site, I manually go in a remove the contact from the list I just added them to.

 

3) When I run my test again and try to add them to that list through the Update process, they do not get added and a receive a Success code from the update process.  Other information that I update (like changing the last name) DOES get updated.

 

Where it gets stranger is that that same Update process will work if I come back to it after some significant time has passed.  Is there some logic that will not let me readd a contact to a list within a specific time frame?

 

Here is the XML that doesn't seem to be updating the Lists:

 

<entry xmlns="http://www.w3.org/2005/Atom">
  <link href="/ws/customers/garlic1/contacts/10048" rel="edit" />
  <id>http://api.constantcontact.com/ws/customers/garlic1/contacts/10048</id>
  <title type="text">Contacts for Customer: garlic1</title>
  <updated>2012-07-06T09:38:36-07:00</updated>
  <author>
    <name>Constant Contact</name>
  </author>
  <content type="application/vnd.ctct+xml">
    <Contact xmlns="http://ws.constantcontact.com/ns/1.0/" id="http://api.constantcontact.com/ws/customers/garlic1/contacts/10048">
      <Status>Active</Status>
      <EmailAddress>bernn@islandceramics.com</EmailAddress>
      <Name>JOANNE BARKER</Name>
      <FirstName>JOANNE</FirstName>
      <MiddleName></MiddleName>
      <LastName>BARKER</LastName>
      <PostalCode>95020</PostalCode>
      <ContactLists><ContactList id="http://api.constantcontact.com/ws/customers/garlic1/lists/1"><link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/garlic1/lists/1" rel="self" /><OptInSource>ACTION_BY_CUSTOMER</OptInSource><OptInTime>2012-07-06T09:38:36-07:00</OptInTime></ContactList><ContactList id="http://api.constantcontact.com/ws/customers/garlic1/lists/2"><link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/garlic1/lists/2" rel="self" /><OptInSource>ACTION_BY_CUSTOMER</OptInSource><OptInTime>2012-07-06T09:38:36-07:00</OptInTime></ContactList><ContactList id="http://api.constantcontact.com/ws/customers/garlic1/lists/3"><link xmlns="http://www.w3.org/2005/Atom" href="/ws/customers/garlic1/lists/3" rel="self" /><OptInSource>ACTION_BY_CUSTOMER</OptInSource><OptInTime>2012-07-06T09:38:36-07:00</OptInTime></ContactList></ContactLists>
      <Confirmed>false</Confirmed>
      <LastUpdateTime>2012-07-06T09:38:36-07:00</LastUpdateTime>
    </Contact>
  </content>
  <source>
    <id>http://api.constantcontact.com/ws/customers/garlic1/contacts</id>
    <title type="text">Contacts for Customer: garlic1</title>
    <link href="contacts" />
    <link href="contacts" rel="self" />
    <author>
      <name>garlic1</name>
    </author>
    <updated>2012-07-06T09:38:36-07:00</updated>
  </source>
</entry>

 

Thanks,

 

Joanne

2 REPLIES 2
Highlighted
Trusted Contributor

Re: Re-adding contact to a list

Hi Joanne,

 

The user interface (website) has using caching, which can cause a delay of up to a few minutes before the results of certain API requests become apparent in there. If the API response indicates that the request was successful, however, the action request should have be carried through properly. A GET request for the contact's details immediately after update should indicate the action was actually completed.

Mark Coleman
Support Engineer
Highlighted
Trusted Contributor

Re: Re-adding contact to a list

Hello Joanne,

 

I corrected a misunderstandind I had in my previous response, but I am curious as to whether an immediate GET request after your apparent successful re-add of contacts that have been removed reveals the action actually wasn't carried out.  Due to caching in the UI, delays in contacts showing up there after adding them to lists through the API are expected, but delays or failures to update/add contacts to lists after an API Request immediately after an API request to do so, would be an issue. I'll be trying some testing of this later and follow-up if I find that there is actually an issue with the API at play here.

Mark Coleman
Support Engineer
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