Wednesday, 4 November 2009

Nice thought piece on APIs from Revolution magazine

I like this 'thought piece' from Revolution magazine on APIs and the future.

The article's "pros and cons" paragraph is particularly interesting, and the section about the importance of 'abstracting' the API from how the underlying service really works was important to me when designing the Grocery API.

Our underlying grocery service is a complex system with many components, and if I enabled it fully through the API:
  1. It might be easier to recreate without our permission (the grocery service is part of's intellectual property).
  2. It would be more difficult to use - or rather, easier to use incorrectly.
  3. It might be easier to attack through uncovering any unknown flaws in the system due to its complexity.
That's why our design distilled the entire grocery service into just 10 basic commands - a complete abstraction from the real service over which it sits:
  1. Login
  2. List product categories
  3. List products in a given category
  4. Search for products by text search / barcode
  5. List Basket
  6. Change Basket (a single command for adding / deleting / changing quantity)
  7. List Delivery Slots
  8. Select a delivery slot
  9. List pending orders
  10. Amend Order
These commands are easy to understand, obvious to use (I hope) and protect the underlying service from attack through misuse.

The Revolution article then concludes with a salient point:
Opening up a site's API is not simply a cheap option for brands to get free coding; there are costs involved in monitoring use, refreshing the technology and supporting developers. It is also a dud option for brands that are unexciting to developers.
We better make sure stays exciting then...!

No comments:

Post a Comment

As this blog grows in readership - and because it carries the Tesco brand - I have had to become more careful about the sort of comments that are acceptable. The good news is that I'm a champion of free speech so please be as praising or as critical as you wish! The only comments I DON'T allow through are:

1. Comments which criticise an individual other than myself, or are critical of an organisation other than Tesco. This is simply because they cannot defend themselves so is unfair and possibly libellous. Comments about some aspect of Tesco being better/worse than another equivalent organisation are allowed as long as you start by saying "in my personal opinion.." or "I think that...". ... followed by a "...because.." and some reasoned argument.

2. Comments which are totally unrelated to the context of the original article. If I have written about a mobile app and you start complaining about the price of potatoes then your comment isn't going stay for long!

3. Advertising / web links / spam.

4. Insulting / obscene messages.

Ok, rules done - now it's your go: