The power of a good API

As I have found out this week the alur of a good API can make up for a multitude of sins.

At work I have been looking at methods for posting documents programmatically, that is sending a PDF to an API and having someone else print and post it. Internally the service Docmail is being used and the plan was to hook into their API to continue using the service, sadly the road was blocked by their SOAP API and out of date and incompatible libraries. Not wanting to mess around with that I started looking for alternatives and found ClickSend.

ClickSend are a company that offers a lot of messaging services including a postal service for sending of letters and unlike Docmail their service doesn't look like it was put together last century. They have a lovely json API and a modern library that was really quick to integrate with. Unfortunately thats where the loveliness ended.

I was initially caught out by a 400 error masquerading as a 500 error but that was fairly minor in the grand scheme of things. Its important to us to have the documents printed and posted in a good format especially with where and how the delivery address gets printed so I ran through a few documents to test the process, this is where the pricing errors started cropping up.

Over the course of a few days I was hit by the price being displayed incorrectly in the UI, the price being calculated incorrectly for non duplexed documents, the actual price not matching the advertised price due to rounding issues and most annoyingly a price match promise that's as useful as this rant! Somehow they seemed to pack in every pricing related bug you could think of.

Normally after hitting any one of these issues I would mark them up as incompetent as move on but each time I looked at the SOAPy alternative and gave them another chance, even when calculating the cost of sending a letter (with their reduced pricing) would cost more than double what Docmail charge I was still OK with it.

I don't know if it's a very good moral but if you are in a niche area and are easy to integrate with I will apparently put up with a lot of shit, or I have to be really desperate before I start building a SOAP library!