Skip to content
From Zero to API Hero: Consuming 3rd Party APIs Like a Pro. #RailsConf 2016 talk
JavaScript CSS HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Zero to API Hero: Consuming 3rd Party APIs Like a Pro!

Just like there’s an app for that, there’s an API for that! But not all APIs are created equal, and some APIs are harder to work with than others. In this #RailsConf 2016 talk, I will walk through some common gotchas developers encounter when consuming a 3rd party API. I will explain why it’s important to familiarize yourself with the API you’re consuming prior to coding, as well as share tools to help you get acquainted with an API much faster. Lastly, I will go over debugging and testing the API you’re consuming!

API basics

HTTP status codes

  • HTTP Statuses: very user friendly website where to read status codes and meaning.
  • RFC 7231: the spec outlining status codes.
  • Status code definitions by the W3, a little less dense than the actual spec.

HTTP clients / libraries

Sample calls

No auth required calls

Try making these calls in cURL:

Oauth 1.0 call

This call to the Twitter API requires Oauth 1.0 HMAC-SHA1. Try using POSTMAN to make this call (you must sign up for a Twitter API key).

Base url:

Params: screen_name=USERNAME

Using the Authorization builder, pass in your consumer key and secret. Timestamp, nonce, and version should be selected / pre-populated. Make sure "encode oauth signature" is checked. Click on "update request" to populate this info into the call.

Oauth Rails example

  • Sample app using Context.IO API to test authenticating a user with OAuth.

Tools for testing / debugging

You can’t perform that action at this time.