Constant Contact Logo

Constant Contact can be a pretty powerful tool that you can use to spam maintain contact lists for newsletter mailings.  They've just released a RESTful API for manipulating lists and contacts, which is a step up from their old form-driven site vistor API.  It's still pretty tough to use, though, and there is not nearly enough documentation for utilizing it with Perl (although they offer code that implements it with PHP and Java).

After some digging, Matt and I found out there's a known bug with Perl's LWP::Authen::Digest module, which is required since the Constant Contact's RESTful API requires Digest authentication. We circumvented the bug by correcting it in our own version of the module.

Although the RESTful API provides more functionality, all we needed was some plain-Jane adding to different contact lists for people requesting to be on a newsletter. With their old API, all the developer had to do was make a POST request to a certain URL, setting several key variables such as username, password, and requested list. The RESTful API mucks up things a bit, though. The biggest difference is that instead of POSTing several variables, the developer has to not only send a whole ATOM entry object, but must either make a POST, GET, or PUT request, depending on the nature of the operation. Oy. In our case, we ran up against the case when an email address had once been in user's Constant Contact lists, but had been removed. The email address doesn't get truly removed; rather it remains in that system with the status set to 'Removed'. This matters, since when adding a new Contact, the request must be a POST, but for an existing user, the request must be a PUT. Constant Contact outlines the gory details on their developer site.

In a word, implementing the RESTful Constant Contact API was a pain, owing to shortcomings of our own technology (Perl) and the convoluted nature of Constant Contact's new API. If anything, it's a lesson in how design deficiencies can turn developers away from your technology if you haven't accounted for their platform.

Want to start visualizing your project risks?  Download our free Software Risk Management template