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

Building Better Web APIs (PyCon AU 2014)

Building Better Web APIs (PyCon AU 2014)

Web APIs are how much of the modern web speaks - services speaking HTTP and JSON are ubiquitous, and nearly everything from your phone to your TV interacts with one of them. We'll go over how APIs are structured and versioned, why you should validate your data, and why you should have them in the first place -- and what other best practices are when creating them.

Amber Brown (HawkOwl)

August 03, 2014
Tweet

More Decks by Amber Brown (HawkOwl)

Other Decks in Technology

Transcript

  1. Design for the End User • Expose all the data

    that the user might need • Provide encrypted endpoints
  2. Design for the Implementor • Design to the principal of

    least surprise and lay your resources out in a consistent way • Provide a platform which will cause little need for modification down the line • Provide documentation which adequately and completely explains your API and its semantics - provide examples!!!!
  3. Pinning Methods • URI • route53.amazonaws.com/2013-04-01/hostedzone • Header • ‘Stripe-Version:

    2014-06-17’ • ‘Accept: application/vnd.heroku +json; version=3’
  4. REST in 2014 • GET fetches (RFC 7231) • POST

    is resource specific (RFC 7231) • PUT replaces or creates (RFC 7231) • PATCH updates (RFC 5789) • DELETE removes (RFC 7231)