<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>txilife.com &#187; perl</title>
	<atom:link href="http://www.txilife.com/tag/perl/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.txilife.com</link>
	<description></description>
	<lastBuildDate>Mon, 17 Jan 2011 19:56:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>Constant Contact RESTful API and Perl</title>
		<link>http://www.txilife.com/2009/03/constant-contact-restful-api-and-perl/</link>
		<comments>http://www.txilife.com/2009/03/constant-contact-restful-api-and-perl/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 23:41:40 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.txilife.com/?p=763</guid>
		<description><![CDATA[ Constant Contact can be a pretty powerful tool that you can use to spam maintain contact lists for newsletter mailings.  They&#8217;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&#8217;s still pretty tough to use, though, and there is not [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-807" src="http://www.txilife.com/wp-content/uploads/2009/03/constant-contact-logo.jpg" alt="constant-contact-logo" width="495" height="200" /> <a title="Constant Contact - Table XI" href="http://www.constantcontact.com/index.jsp?pn=tablexi  " target="_blank">Constant Contact</a> can be a pretty powerful tool that you can use to <span style="text-decoration: line-through;">spam</span> maintain contact lists for newsletter mailings.  They&#8217;ve just released a <a href="http://en.wikipedia.org/wiki/Representational_State_Transfer">RESTful</a> API for manipulating lists and contacts, which is a step up from their old form-driven site vistor API.  It&#8217;s still pretty tough to use, though, and there is not nearly enough documentation for utilizing it with <a href="http://www.txilife.com/tag/perl/" class="st_tag internal_tag" rel="tag nofollow" title="Posts tagged with perl">Perl</a> (although they offer code that implements it with PHP and Java).</p>
<p>After some digging, Matt and I found out there&#8217;s a <a href="http://rt.cpan.org/Public/Bug/Display.html?id=43354">known bug</a> with <a href="http://www.txilife.com/tag/perl/" class="st_tag internal_tag" rel="tag nofollow" title="Posts tagged with perl">Perl</a>&#8217;s LWP::Authen::Digest module, which is required since the Constant Contact&#8217;s RESTful API requires Digest authentication.  We circumvented the bug by correcting it in our own version of the module.</p>
<p>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 <a href="http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods">POST request</a> 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 <a href="http://en.wikipedia.org/wiki/Atom_(standard)">ATOM entry object</a>, 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&#8217;s Constant Contact lists, but had been removed.  The email address doesn&#8217;t get truly removed; rather it remains in that system with the status set to &#8216;Removed&#8217;.  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 <a href="http://developer.constantcontact.com/doc/contactsCollection">on their developer site</a>.</p>
<p>In a word, implementing the RESTful Constant Contact API was a pain, owing to shortcomings of our own <a href="http://www.txilife.com/tag/technology/" class="st_tag internal_tag" rel="tag nofollow" title="Posts tagged with Technology">technology</a> (<a href="http://www.txilife.com/tag/perl/" class="st_tag internal_tag" rel="tag nofollow" title="Posts tagged with perl">Perl</a>) and the convoluted nature of Constant Contact&#8217;s new API.  If anything, it&#8217;s a lesson in how design deficiencies can turn developers away from your <a href="http://www.txilife.com/tag/technology/" class="st_tag internal_tag" rel="tag nofollow" title="Posts tagged with Technology">technology</a> if you haven&#8217;t accounted for their platform.</p>

	Tags: <a href="http://www.txilife.com/tag/perl/" title="perl" rel="tag nofollow">perl</a>, <a href="http://www.txilife.com/tag/technology/" title="Technology" rel="tag nofollow">Technology</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.txilife.com/2009/02/txilife-is-alive/" title="txilife is alive (February 17, 2009)">txilife is alive</a> (2)</li>
	<li><a href="http://www.txilife.com/2009/07/recaptcha-retheme/" title="reCaptcha reTheme &#8211; UPDATED (July 6, 2009)">reCaptcha reTheme &#8211; UPDATED</a> (7)</li>
	<li><a href="http://www.txilife.com/2009/02/firefox-browser-chrome/" title="Firefox Browser Chrome (February 25, 2009)">Firefox Browser Chrome</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.txilife.com/2009/03/constant-contact-restful-api-and-perl/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

