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

Hello World Automatic API

C698e3c3733ee56c41eb985eeaed91e8?s=47 Brendan Nee
September 17, 2014

Hello World Automatic API


Brendan Nee

September 17, 2014

More Decks by Brendan Nee

Other Decks in Technology


  1. Hello World Automatic API Automatic Lunch & Learn Sep 17,

  2. None
  3. Automatic API REST Webhook User requested “Give me all of

    the trips for this user between these dates” Sent by Automatic “This user finished a trip just now, here it is”
  4. REST Webhook Automatic API TripViewer Automaticator

  5. Automatic API • Trips • Vehicles • User Info •

    Events REST Endpoints
  6. Trips Endpoint GET https://api.automatic.com/v1/trips curl -H "Authorization: token YOUR-OAUTH-TOKEN" "https://api.automatic.com/v1/trips"

  7. None
  8. Authorization https://www.automatic.com/developer/dashboard/

  9. Authorization https://www.automatic.com/developer/dashboard/

  10. Authorization (quick way) https://dashboard.automatic.com/ • Login • Open Developer Console

    • sessionStorage.accessToken 9386f14f3e289feab41e2c1a577a1ba5e3215166
  11. Sample App https://github.com/automatic/tripviewer • Handles oAuth • Fetches trips •

    Easy to deploy
  12. Requirements • Git • Node.js • Text editor https://gist.github.com/brendannee/a8d07f76a485710a560e

  13. Hello World Automatic API git clone https://github.com/Automatic/tripviewer.git cd tripviewer npm

    install cp config-sample.json config.json TOKEN=YOUR-AUTOMATIC-ACCESS-TOKEN npm start Open http://localhost:3000 in your browser
  14. Text Editor https://atom.io/

  15. Editing Text public/javascripts/summary.js views/summary.jade

  16. • Read developer documentation https://automatic.com/developer/documentation • Try out Automaticator App

    https://github.com/automatic/automaticator • Ask me questions Next Steps