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.

Sample PHP code for API

Occasional Contributor

Sample PHP code for API



Ive looked for sample PHP code to call the API to do things like create,modify,delete contacts etc, and I am poitned to sites like github but there seems to be a lot of php code that can't be found - eg. references to include files etc.


Is there any one location where zip files containing all the necessary code for all the different types of API calls one would want to make to access our existing constant contact DB?


Any help appreciated.

Honored Contributor

Re: Sample PHP code for API



What your'e running into is that the PHP library has two dependencies that are managed using Composer (You can find information on Composer here: If you're not familiar with Composer or are simply not using it to manage your project, you can simply download the dependencies by installing composer and then opening a terminal/command prompt and navigating to the folder where you placed the PHP SDK. Once you're in that folder simply type "composer install" into the command line and everything will be downloaded.


Once you've got the dependencies, you can then just copy the contents of the PHP SDK folder and it will have everything that you need.


If you have any questions, please let me know!



Elijah G.
API Support Engineer
Occasional Contributor

Re: Sample PHP code for API

Thanks Elijah


I'll take a look at what you've said.


Appreciate your help.





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