cancel
Showing results for 
Search instead for 
Did you mean: 
Tonight (8/23) from 11:00 PM - 12:00AM ET we need to make a few updates to our site. During this time, no emails will be sent and some customers will not be able to access their contacts. We recommend finishing up your work before 11:00 PM and logging in after 12:00 AM ET. Thank you for your patience while we make these updates.

Get removed contacts

Occasional Contributor

Get removed contacts

I'm using this wrapper: https://github.com/ctctsupport/ctct_php_library/

 

Is there way to get a list of removed contacts? 

1 REPLY 1
Highlighted
CTCT Employee

Re: Get removed contacts

Hello,

 

The best way to get a list of removed contacts in our API is to get a list of "list members" from the removed list.  Unfortunately, in the wrapper, when using the "getLists" function, it ignores the Active, Removed, and Do Not Mail lists.  So that when you do the getListMembers function, you cannot pick the removed list.

 

The work around to this would be to edit the Collections.php file and go to the getLists function, and take out the Removed list from the ignoreArray array.  Then when you do a getLists, it will show the removed list as list "0".  You would then be able to get the list members from that list.

 

After removing "removed" from the array, here is the code that I used that worked:

 

<?php
    include_once ("ConstantContact.php");
    $ConstantContact = new ConstantContact('basic', "API KEY", "USERNAME", "PASSWORD");
    $lists = $ConstantContact->getLists();
    $members = $ConstantContact->getListMembers($lists['lists'][0]);
    print_r ($members);
?>

 

If you have any questions please let me know.

 

Regards,

 

Ben Soder

Benjamin Soder
NOC Analyst
Constant Contact