A Tale Of Two API's
Posted By : todd sharp Posted At : April 28, 2009 8:15 PM Posted In: Java, ColdFusion, SlideSix
5
SlideSix, like many other social networks these days, has long offered the ability to import a contact list from your favorite webmail client for the purpose of sending a quick invitation to your friends to join. Some people aren't a fan of such services, but as my favorite TV personality likes to say - "that's another show".
In all reality, it's quite a handy feature to have - and a good way to get some viral marketing out of your users that are really excited about your product. Make it dead simple for them to tell a lot of friends about your service and you just might find word spreading quickly.
So as I stated above, we've offered this service for quite some time now. But recently I took notice that despite the fact that a lot of users were actually hitting the page, no invites were being sent. I found it a bit curious so I logged in and ran a quick test which yielded zero contacts in my Gmail account (of which I knew there were hundreds). My first reaction was that I had inadvertently introduced a bug into my code but a quick check confirmed that I hadn't made any changes. My next step was to head off to the support site for the service that I had been using to abstract the contact list import - a service called Rapleaf. I did some quick searching around there site, but I couldn't even find the API documentation for their address book API. I eventually found the documentation which contained the following note at the top of the page:
NOTE: Since Rapleaf is now focusing on our core set of APIs, we are no longer offering support for the Address Book API
I should state that I don't have a problem with a company changing gears and focusing on a different, most likely more profitable part of their business. It happens every day and it only makes sense to focus on elements that bring in the most bang for the buck. What I do have a problem with is the fact that I had to search, pretty hard I might add, for the fact that the API was no longer supported. Since I had taken the time to actually sign up for an API key I think it would have been decent of them to send a quick email out to developers letting them know that they were no longer supporting it. I'll give them the benefit of the doubt and assume that they did send a message but I somehow overlooked it or it got caught by a rogue spam filter.
Unfortunately at this point I was left high and dry without a service to use to import contacts. I could have taken the time to build my own service, but since my existing service was not functioning I didn't have the luxury of time on my side. So off I went to do some searching for a new alternative. I quickly found a paid option from a company called Octazen Solutions. They offer a huge set of supported webmail clients and sell a library for most popular programming languages. After a bit of research I decided to go with their package.
I should note that although they do offer their library in ColdFusion (my language of first choice) I chose to go with the Java library instead. Why? First off they don't show any ColdFusion samples on their site so I had no idea what they're offering (custom tag? CFC?). Secondly, I found it kinda silly that the ColdFusion option was priced at $200 and the Java option was priced at $88. Why is that silly? Well, since ColdFusion runs on Java I could easily save myself more then a hundred bucks by purchasing the Java library and creating the Java object directly within ColdFusion. Long story short I went with the Java library, and thanks to Mark Mandel's JavaLoader I got the package up and running in about 2 lines of code. Seriously.
<cfset contacts = simpleAddressBookImporter.fetchContacts(arguments.user,arguments.pass) />
Which returned a nice array of contacts like such:
Thankfully I have the feature back up and running, and now better then ever since I can offer support for way more clients than I was before. Octazen was pretty quick to ship my license and even quicker to respond to a licensing question I posed to them. If you're looking for a contact importing solution I'd recommend taking a look at their product. You can also try it out on SlideSix (must be logged in).



Coincidentally we were looking at it again yesterday, so your post couldn't have been timed better!
Cheers!
It turned out that having several instances of CF running caused issues with the logging files. It only appears to work on sites setup with the default instance of CF i.e. cfusion.