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:
- 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.
- 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”
- 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.
- 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.