$30 off During Our Annual Pro Sale. View Details »

Hello World Automatic API

Brendan Nee
September 17, 2014

Hello World Automatic API

Brendan Nee

September 17, 2014
Tweet

More Decks by Brendan Nee

Other Decks in Technology

Transcript

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

    View Slide

  2. View Slide

  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”

    View Slide

  4. REST Webhook
    Automatic API
    TripViewer Automaticator

    View Slide

  5. Automatic API
    • Trips
    • Vehicles
    • User Info
    • Events
    REST Endpoints

    View Slide

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

    View Slide

  7. View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  11. Sample App
    https://github.com/automatic/tripviewer
    • Handles oAuth
    • Fetches trips
    • Easy to deploy

    View Slide

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

    View Slide

  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

    View Slide

  14. Text Editor
    https://atom.io/

    View Slide

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

    View Slide

  16. • Read developer documentation
    https://automatic.com/developer/documentation
    • Try out Automaticator App
    https://github.com/automatic/automaticator
    • Ask me questions
    Next Steps

    View Slide