In this post I’ll quickly run through accessing the Xero API using Java and the super simple, elegant Scribe library. There’s a support page dedicated to Java + Xero API but I found it a bit light on help for those setting up a public application for the first time in Java, so the below steps should help others wanting to get up and running. For the actual access to Xero we’ll be using Ross Jourdain’s excellent Xero library, which handles mapping the XML into Java objects for you. I’ve made a couple of tweaks to it to support App Engine, and Scribe. I have also set up a
XeroExample in the Srcibe format, for use with the library.
The other reason you might like these instructions rather than the default, is that we run our apps on Google App Engine for Java and so we had to make a few changes to the way we access Xero in order to meet the GAE requirements. The Scribe library supports GAE out of the box.
Why am I mucking about with the Xero API, anyway? We’re working on an app that connects Xero with Amazon for merchants to import accounting data automatically. I’m not quite ready to tell the world about it, but if you’re interested in trying it, get in touch.
Let’s get started with the Xero API, a public application, and Java!