News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Lorna Mitchell:
How NOT to Design Your API
January 10, 2013 @ 10:46:04

Recently Lorna Mitchell asked the wide world of Twitter about some of their recommendations of things not to do when creating an API. In this new post to her site, she gathers together those responses including comments about documentation, consistency and response codes.

Recently I tweeted as a #linktuesday link the 10 Worst API Practices post from ProgrammableWeb. Today, in search of some concrete examples of APIs implementing unhelpful antipatterns, I sent out a tweet for help: "What's the most frustrating inconsistent/misleading bit of API you've seen? Looking for cautionary tales!" [...] In the raft of responses (and thankyou all, this was fabulous, helpful and entertaining in equal parts!), there were some definite patterns that I'd like to share with you, in no particular order.

Comments came in from all over and talked about things like:

  • Response codes not matching the content (ex. 200 on an error)
  • NullPointerExceptions
  • Different endpoints for single vs collections
  • Order-sensitive XML in requests
  • Poor error handling
  • Bad documentation
  • Incorrect content type handling
So there you have it, the sins to avoid in your own APIs. If you've encountered any of these, please accept my condolences.
0 comments voice your opinion now!
api design response code error handling documentation opinion twitter


blog comments powered by Disqus

Similar Posts

PHPMaster.com: REST - Can You do More than Spell It? Part 4

Chris Jones: Getting Started with PHP Zend Framework 2 for Oracle DB

PHPClasses.org: Lately in PHP Podcast Episode 21 - Is PHP Source Quality Really Good?

Ldeveloper Tech Blog: PHP - Fatal error: Uncaught SoapFault exception: Could not connect to host...

Ralph Schindler's Blog: PHP Constructor Best Practices And The Prototype Pattern


Community Events

Don't see your event here?
Let us know!


framework laravel5 podcast series interview unittest introduction security release symfony language threedevsandamaybe version api extension community laravel opinion voicesoftheelephpant library

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework