Building your API Utility Belt

Building your API Utility Belt

No matter the situation, Batman always had the perfect tool on hand. It didn't matter how rare, bizarre, or unique the situation was, he was ready to save the day. Unfortunately, in software development, we don't have a utility belt. At best, our tools are scripts we've cobbled together over the years that solve particular problems but leave us stuck more often than not. In this talk, we'll work to change that. This talk will introduce you to seven tools that are vital to everyday API usage and development.

23365b2ae97212e561fb82442857d8bb?s=128

Keith Casey

June 03, 2015
Tweet

Transcript

  1. BUILDING YOUR API UTILITY BELT D. KEITH CASEY JR. @CASEYSOFTWARE

    KEITH@CASEYSOFTWARE.COM
  2. Who am I?

  3. Who am I?

  4. Who am I? http://TheAPIDesignBook.com

  5. AGENDA ASSUMPTIONS THE PROBLEMS THE STATUS QUO THE RIGHT TOOLS

  6. Disclaimer Some of the tools and services covered here are

    open source, some are commercial products, and some are a blend of both. I have no vested interest in any of them though I know people at all of the companies involved. * Also, all pictures used without permission or attribution.
  7. AGENDA ASSUMPTIONS THE PROBLEMS THE STATUS QUO THE RIGHT TOOLS

  8. Assumptions You have a technical background APIs are an important

    part of your job Use them on a regular basis Potentially build them too Sometimes public, sometimes private
  9. Assumptions Nothing is perfect You make mistakes Your providers make

    mistakes That other team are knuckleheads
  10. Assumptions You acknowledge the real Batman Ben Afleck Christian Bale

    George Clooney Val Kilmer Michael Keaton
  11. Assumptions You acknowledge the real Batman Ben Afleck Christian Bale

    George Clooney Val Kilmer Michael Keaton
  12. Assumptions

  13. AGENDA ASSUMPTIONS THE PROBLEMS THE STATUS QUO THE RIGHT TOOLS

  14. The Problems…

  15. Only one problem: Testing APIs sucks.

  16. AGENDA ASSUMPTIONS THE PROBLEMS THE STATUS QUO THE RIGHT TOOLS

  17. The Status Quo…

  18. The Status Quo No wait, that sucks too.

  19. AGENDA ASSUMPTIONS THE PROBLEMS THE STATUS QUO THE RIGHT TOOLS

  20. TOOL 1: CURL & LIBCURL

  21. Background Completely open source with tons of integrations Incredible power

    and flexibility Incredible complexity
  22. Common Commands -X specify an HTTP verb -d specify data

    fields, such as for a POST -I return/display all the returned headers -H specify extra/custom headers
  23. Getting Started curl https://api.github.com curl -I https://api.github.com curl https://api.github.com/user/repos curl

    -u caseysoftware -X POST https:// api.github.com/user/repos -d ‘{“name”:”monkey”}’
  24. http://curl.haxx.se/docs/manual.html (35 pages, no kidding..)

  25. TOOL 2: POSTMAN

  26. Background Started in Sept 2013, raised $1MM May 2015 Over

    3M users (as of June 2016) Free but with some paid extensions
  27. Common Commands (there really aren’t any - point & click)

  28. Getting Started (psst.. open postman)

  29. The Real Power

  30. https://www.getpostman.com/docs

  31. TOOL 3: BDD IRL

  32. Background Different from Unit Testing in that we step outside

    the system and take the users’ point of view Tools in just about every language: Cucumber, Behave, Behat, etc Uses the Gherkin syntax
  33. Our Syntax It’s English, but in the Gherkin syntax so

    this: As a [role] I want [feature] so that [benefit] becomes a feature structured as: Given [condition] when I [action] then [result]
  34. Getting Started

  35. http://docs.behat.org/

  36. TOOL 4: FIDDLER

  37. Background Created by Telerik, based on .NET (Mono) Serves as

    a local proxy, not a tool for requests Free to use; some paid, some free extensions Geoedge - route traffic through 130 locations
  38. Common Functionality Active Man in the Middle (MITM) Logging and

    Recording Traffic & Payload Analysis Manipulation/Modification Your logs kept locally
  39. None
  40. None
  41. http://www.telerik.com/fiddler http://www.telerik.com/fiddler/add-ons

  42. TOOL 5: API TOOLS

  43. Background Powered by 3Scale (acquired by Redhat recently) Serves as

    a proxy, not a tool for requests Web-based, only good for public APIs OSS - local via RPM (or Vagrant or Docker)
  44. Common Functionality Active Man in the Middle (MITM) Logging and

    Recording Traffic & Payload Analysis Manipulation/Modification Your logs kept locally (or in the cloud!)
  45. TOOL 6: STOPLIGHT.IO

  46. Background Started Dec 2014, still Beta but interesting Serves as:

    a proxy & documentation generator Web-based, primarily for public APIs Using ngrok, you can share localhost
  47. Common Functionality Active Man in the Middle (MITM) Logging and

    Recording Traffic & Payload Analysis Generates Documentation Heavy focus on collaboration & sharing
  48. Getting Started (psst.. open stoplight)

  49. https://designer.stoplight.io/docs

  50. TOOL 7: RUNSCOPE

  51. Background Started in Dec 2012, funded by a16z and others

    Serves as a proxy, performance monitoring, usage tracking, unit testing, monitoring, etc Web-based, primarily for public APIs Using ngrok, you can share localhost
  52. Common Functionality Active Man in the Middle (MITM) Logging and

    Recording Traffic & Payload Analysis Your logs are kept in the cloud Incredibly easy to share requests & callbacks
  53. Getting Started https://runscope.com

  54. https://runscope.com/docs

  55. To compare… Active MITM? Logs? Collaboration? Docs Generation? Testing &

    Validation? Fiddler yes local no no no API Tools yes internal share results no yes Stoplight.io yes local for definitions yes no Runscope yes cloud share results no yes
  56. AGENDA ASSUMPTIONS THE PROBLEMS THE STATUS QUO THE RIGHT TOOLS

  57. None
  58. None
  59. D. KEITH CASEY JR. @CASEYSOFTWARE KEITH@CASEYSOFTWARE.COM BUILDING YOUR API UTILITY

    BELT
  60. Who am I? http://TheAPIDesignBook.com