Upgrade to Pro — share decks privately, control downloads, hide ads and more …

12 Reasons Your API Sucks - Lone Star PHP

12 Reasons Your API Sucks - Lone Star PHP

New version: https://speakerdeck.com/caseysoftware/12-reasons-your-api-sucks-2017-rev

Those first moments of using an API are pivotal. There’s nothing like downloading this week’s PDF of the documentation, setting up a SOAP client, reconfiguring all your URLs, and decoding the latest binary payloads. It makes your heart sing and your blood pressure rise. Just like there are code smells through the rest of your project, there are API smells that make them hard to design, hard to launch, and hard to maintain. We’ll use this time to explore a few common APIs to highlight those issues and demonstrate strategies to fix the issues before they become problems.

Keith Casey

April 25, 2014
Tweet

More Decks by Keith Casey

Other Decks in Technology

Transcript

  1. Techstars London “Company to Watch” - Fintech 50 “Top five

    companies to watch from Hy!” - Engadget SXSW Accelerator 2014 Selected for the BBC Media Labs Currently in Private Beta
  2. Developer Experience is to Developers as User Experience is to

    Users* – That dude in front of you right now *sorta
  3. “I set aside an hour..” Not really, but you really

    tried.. phone calls, emails, IM, etc, etc “do you have a minute?” TPS reports
  4. 5. SOAP as the interface REST is like borrowing $10

    from a friend SOAP is like a mortgage
  5. Who is the API for? Is this an internal API

    that was released publicly? Is this an API specifically built for external use? Where does the API fit into their business? aka Is it bolted on or a key part of the company?
  6. Sidebar: Remember, URIs just need to uniquely address resources, they

    don’t need to be human readable or pretty or even marginally cute.
  7. 7. Poor workflow & modeling Affordances What is the API

    producer’s goal? What problem(s)/task(s) does it make simple? What do you want to do?
  8. POST -d (data) /api/v1/accounts /api/v1/contacts /api/v1/contact_histories /api/v1/users/current /api/v1/contact/:id/groupings ! 201,

    Location header 200, Resource 201, Location header 201, Location header 201, Location header 9. Payloads
  9. Adopting Logical & Consistent Designed workflows vs random junk The

    One True Way Consistent Payloads Authentication