5 Ways To Tell Your Web API Isn’t Mobile Friendly

APIs are like opinions.  Everyone’s got one and most of them suck.  See if your site’s API is mobile ready:

5 ways to tell your API isn’t mobile friendly:

  1. It returns all of an object, all the time – Good APIs return only the most important parts of an object or resource, especially in an index feed.  Bad APIs return everything, regardless of whether it’s important to a mobile device.  It’s all about bandwidth and data transfer.  Only send what you need.
  2. There’s HTML in your XML – Mobile devices don’t need your HTML, CSS, or JavaScript.  Keep it out of your API.
  3. Error?  Here’s your number – A good API should have error codes clearly defined either in documentation or in the response.  REST based APIs have some of this built in, but your 3rd party developers will need to know something more than just “something broke”
  4. It uses SOAP –  WSDLs.  Namespaces (tons of them).  Tons XML talking about what the XML should be.  SOAP is very clear and well defined.  It’s also fat;tons of XML but not a lot of content.  That’s just more data to transfer and more XML to parse.  Lots of wasted memory and CPU cycles both of which are precious commodities on a mobile device.  Yes it’s convenient for big Java implementations and .Net sites but it’s terrible for mobile.    SOAP is like the federal government of webservices.
  5. Your documentation is (only) autogenerated – If you build it, they will come, but only if they can figure out how to use it.  There’s rarely such a thing as too much documentation.  If a returned field is simply called int, and your docs don’t say what that int means, you’re not ready to deal with mobile.
Advertisements

Posted on August 19, 2011, in Gripes and tagged , . Bookmark the permalink. 2 Comments.

  1. What to use instead of SOAP?

    • I prefer restful web apis. The XML is usually similar and there’s not wsdls to deal with up front. Many of them use JSON which has been shows to be quicker than XML on the device side.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: