Using the Connect Pro web service API with ColdFusion
Part of my current focus in my product management role on the Connect team is the Connect Pro web service APIs (you can find more documentation on what they are here). Given my background in ColdFusion I thought it would be an interesting experiment using the API’s inconjunction with ColdFusion. I was surprised to find very little via google on using ColdFusion with Connect as I’m sure it’s something lots of folks have played around with.
Anyway as part of my learning I’ve started to pull together a CFC facade that makes achieving common API calls less verbose and returns Connect XML structures back to the ColdFusion developer as Query objects types (as I prefer them to work with given the increased ease, flexibility and performance over XML object types from within ColdFusion.
It’s pretty rudimentary at this point as I’ve only invested a couple of hours of time, but wanted to share the CFC with you.
Currently I’ve only implemented the following Connect API methods
I’ve done no code optimisation or refactoring, so please no comments on how shoddy the code really is …
Here’s an example of using the CFC facade to login and get a list of my meetings
And here’s the output when you throw the query object into HTML using the CFDUMP tag
The important thing to note here is what this code would need to look like without the Connect Facade CFC, which is something like this
As you can see it’s fairly basic at this point, but as the coming weeks I plan to further expand the API coverage, optimise the code and then start to integrate it with LiveCycle Data Services to demonstrate taking Connect content offline using an AIR application.
Until then enjoy playing with the 0.1 release of my ConnectFacade CFC
Oh, I forgot to mention I make use of the very useful XmlTOStruct CFC by Anuj Gakhar, which can be found here