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

UW Advanced Rails Week 4

UW Advanced Rails Week 4

Ben Woodall

April 23, 2015
Tweet

More Decks by Ben Woodall

Other Decks in Programming

Transcript

  1. Why an API? Allow other applications to interface with our

    services Useful for data driven development 3
  2. REST API Data Formats JSON JavaScript Object Notation MIME type:

    application/json XML Extensible Markup Language MIME type: application/xml and text/xml 4
  3. JSON Example { "shorturl": "lf64kr", "user": { "id": 2, "name":

    "benwoodall", "email": "[email protected]" }, "array": [1,3,5,7] } 5
  4. XML Example <?xml version="1.0" encoding="UTF-8" ?> <root> <shorturl>lf64kr</shorturl> <user> <id>2</id>

    <name>benwoodall</name> <email>[email protected]</email> </user> <array>1</array> <array>3</array> <array>5</array> <array>7</array> </root> 6
  5. We need an API end-point to create short urls Requests

    should be authenticated against 8 What do we know so far?