Building your API utility belt (Keith Casey)
-
Upload
future-insights -
Category
Technology
-
view
451 -
download
0
Transcript of Building your API utility belt (Keith Casey)
BUILDING YOUR API UTILITY BELTD. KEITH CASEY, JR AUSTIN, TX [email protected] @CASEYSOFTWARE
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.
Assumption:
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
Assumption:
Nothing is perfect
You make mistakes
Your providers make mistakes
That other team are knuckleheads
Assumption:You acknowledge the real Batman
Ben Affleck
Christian Bale
George Clooney
Val Kilmer
Michael Keaton
Assumption:You acknowledge the real Batman
Ben Affleck
Christian Bale
George Clooney
Val Kilmer
Michael Keaton
Assumption:You acknowledge the real Batman
Ben Affleck
Christian Bale
George Clooney
Val Kilmer
Michael Keaton
curl / libcurl
Completely open source with tons of integrations
Incredible power and flexibility
Incredible complexitiy
Common curl Parameters
-X specify an HTTP verb
-d specify data fields, such as for a POST
-I return/display all the included headers
-H add extra/custom headers
Getting Started
curl https://api.github.com
curl -I https://api.github.com
curl http://api.github.com/user/repos
curl -u caseysoftware -X POST https://api.github.com/user/repos -d ‘{“name”:”monkey”}’
Background
Started September 2013, raised $1MM May 2015
Over 1.5M users, 800k are active
Chrome Plugin - free, but has paid extensions
Getting Started
curl https://api.github.com
curl -I https://api.github.com
curl http://api.github.com/user/repos
curl -u caseysoftware -X POST https://api.github.com/user/repos -d ‘{“name”:”monkey”}’
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
Catch my talk “Is your API Misbehaving”
Our Syntax
It’s English, but in the Gherkin syntax so this:
As a [role] I want [feature] so that [benefit]
becomes a feature called:
Given [condition] when I [action] then [result]
Background
Created by Telerik, based on .Net (Mono)
Serves as a local proxy, not a tool for requests, etc
Free to use; some paid, some free extensions
Geoedge - route traffic through 130 locations
Common Functionality
Active Man In The Middle (MITM)
Logging and Recording
Traffic & Payload Analysis
Manipulation
Your logs are kept locally
Full docs
http://docs.telerik.com/fiddler
http://www.telerik.com/fiddler/add-ons
Background
Powered by 3Scale
Serves as a proxy, not a tool for requests
Web-based, only good for public APIs
Local Debian (or Vagrant or Docker) - OSS
Common FunctionalityActive MITM FTW!
Logging and Recording
Traffic & Payload Analysis
Manipulation
Your logs are kept:
In the cloud or locally, your choice!
Full docs
https://docs.apitools.com/docs/
But seriously.. it’s really only 2 steps.
Background
Started Dec 2014, still Beta but interesting
Serves as: a proxy and documentation generator
Web-based, primarily for public APIs
Using ngrok, you can share localhost
Common Functionality
Active MITM FTW!
Logging and Recording
Traffic & Payload Analysis
Generates Documentation
Heavy focus on collaboration & sharing
Background
Started Dec 2012, well-funded by a16z and others
Serves as: a proxy, performance monitoring, unit test, usage tracking, API monitoring
Web-based, primarily for public APIs
Using Passageway, you can share localhost
Common Functionality
Active MITM FTW!
Logging and Recording
Traffic & Payload Analysis
Your logs are kept in the cloud
Incredibly easy to share requests & callbacks
BUILDING YOUR API UTILITY BELTD. KEITH CASEY, JR AUSTIN, TX [email protected] @CASEYSOFTWARE