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

Principles of Awesome APIs and How to Build Them.

Principles of Awesome APIs and How to Build Them.

Keavy McMinn

November 18, 2019
Tweet

More Decks by Keavy McMinn

Other Decks in Programming

Transcript

  1. Principles of Awesome APIs and How to Build Them. Keavy

    McMinn, Fastly RubyConf 2019 @keavy
  2. API Descriptions — JSON Schema — Open API (formerly Swagger)

    — RAML — APIs.json — API Blueprint — Postman Collections — Async API
  3. # Get a dog. get "/dogs/:dog_id" do authorize_access :users, :bots

    # finds the dog # renders the dog as JSON end
  4. Invest in upfront design. — What will users do with

    it? — What does your business need from it? — What does it look like? — What will you call it?
  5. Remember: puppies APIs are for life not just for Christmas!

    https://www.flickr.com/photos/27587002@N07/5170590074
  6. Well-documented Enable a holistic view. — Endpoints that are undocumented

    — Endpoints that are in any special phase — Anything to be deprecated — Dates
  7. It doesn’t have to be fucking hard. It just has

    to be consistent. Which is fucking hard. — Brett Sutton, Triathlon coach