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.

Output Subscriber list to a private website

Occasional Participant

Output Subscriber list to a private website

Hello, I would like to create a page on my website that displays a particular contact list. This page will be password protected. Is there a pre-written script that accomplishes this? If not, how can I call a Constant Contact database from my website? I have a script that accomplishes the same task but it calls for a database that is on my own server. it looks like this. Am I able to reconfigure this to work with a constant contact database? Thanks!


@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM theManors";



echo "
Database Output


while ($i < $num) {


echo "




Id Sal. First Name Last Name Street City Province Postal Code Phone (D) Phone (E) Source Type Email
$id $salutation $firstName $lastName $street $city $province $postCode $phone $evePhone $source $type $email

You can certainly output the contents of a contact list through your website. You can obtain general information about a specific list by Retrieving an individual list. If you're looking to display each member of that list (which it sounds like you are), you would want to look at Obtaining subscribers in a contact list. Unfortunately we don't have this exact script written up, but you can get a fair way through what would be needed to implement this by looking at our Code Samples page.

In essence, you're looking to perform an http get on https://api.constantcontact.com/ws/customers/{user-name}/lists/{list-id}/members. Once this information is retrieved you would loop through each returned entry and use that to populate your $firstName, $lastName, $city..etc variables. Be aware that this will only return a maximum of 50 contacts per page, and further pages will be available be access the link in the <link> node w/ the relative attribute 'next'. For example:

<link href="/ws/customers/{user-name}/lists/{list-id}/members?next=gilznato-ftfj0w" rel="next"></link>

I hope this help, please let us know if you have any other questions or concerns regarding this.

David J

Occasional Participant

Thanks for your quick respone! I will give this a try.



Developer Portal

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

Visit Page