YOW!Nights March 2013Kevin O’NeillCTO PlayUp@kevinoneill
Kevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
Kevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
Kevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
Roadmap          •       ReST and Hypermedia          •       An example of a Hypermedia driven service          •       T...
A jumping off pointKevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
OpinionatedKevin O’Neill - CTO PlayUp - @kevinoneill       YOW! Nights - March 2013
RealKevin O’Neill - CTO PlayUp - @kevinoneill          YOW! Nights - March 2013
ReST & HypermediaKevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
Representational State Transfer (ReST) is a          style of software architecture for distributed                hyperme...
ReSTKevin O’Neill - CTO PlayUp - @kevinoneill          YOW! Nights - March 2013
ReST is not a                       meaningful termKevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
One URL ≠ ReSTKevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
One URL ≠ ReST       http://example.com/system?action=getUser&uid=3       http://example.com/system?action=mkUser&name=…  ...
Resources = ReST ?Kevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
Resources = ReST ?       http://example.com/users/3       http://example.com/users/<uid>       http://example.com/users/<u...
HTTP Verbs = ReST ?Kevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
HTTP Verbs = ReST ?       POST	  http://example.com/users       GET	  http://example.com/users/3       PUT	  http://exampl...
What is ReST really?Kevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
"ReST is software design on the scale of       decades: every detail is intended to promote       software longevity and i...
The constraints of                         ReSTKevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
Client ServerKevin O’Neill - CTO PlayUp - @kevinoneill       YOW! Nights - March 2013
Stateless ServerKevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
CacheableKevin O’Neill - CTO PlayUp - @kevinoneill         YOW! Nights - March 2013
Uniform InterfaceKevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
Layered SystemKevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
Code-On-Demand                       (optional)Kevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
Uniform InterfaceKevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
Identification of                            ResourcesKevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
Manipulation of                  resources through                   representationsKevin O’Neill - CTO PlayUp - @kevinone...
Self-descriptive                           messagesKevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
Hypermedia as the           engine of application                   stateKevin O’Neill - CTO PlayUp - @kevinoneill   YOW! ...
“What needs to be done to make the ReST       architectural style clear on the notion that       hypertext is a constraint...
A Hypermedia driven                 serviceKevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
PlayUp PassKevin O’Neill - CTO PlayUp - @kevinoneill       YOW! Nights - March 2013
Kevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
Getting the Price                                                                               TMS                     2 ...
Products       ":type":	  "application/vnd.playup.ticketing.product+json",	         "product":	  {       	  	  	  	  "deta...
Products       ":type":	  "application/vnd.playup.ticketing.product+json",	         "product":	  {       	  	  	  	  "deta...
Preview       ":type":	  "application/vnd.playup.ticketing.product+json",	         "product":	  {       	  	  	  	  "detai...
Preview       ":type":	  "application/vnd.playup.ticketing.product+json",	         "product":	  {       	  	  	  	  "detai...
Accept HeaderKevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
Accept Header       Accept       application/vnd.playup.stream.story+json,*/*Kevin O’Neill - CTO PlayUp - @kevinoneill    ...
Preview       ":type":	  "application/vnd.playup.ticketing.product+json",	         "product":	  {       	  	  	  	  "detai...
URI ParameterizationKevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
URI Parameterization       ":type":	  "application/vnd.playup.ticketing.product+json",	         "product":	  {       	  	 ...
URI Parameterization       http://april.ticket-­‐provider.playupdev.com/content/82/preview?       token=ABBr0dVOGRdPpF%2BA...
Offers       ":type":	  "application/vnd.playup.ticketing.product+json",	         "product":	  {       	  	  	  	  "detail...
Offers       ":type":	  "application/vnd.playup.ticketing.product+json",	         "product":	  {       	  	  	  	  "detail...
Offers       ":type":	  "application/vnd.playup.ticketing.product+json",	         "product":	  {       	  	  	  	  "detail...
Offers       ":type":	  "application/vnd.playup.ticketing.product+json",	         "product":	  {       	  	  	  	  "detail...
Media TypesKevin O’Neill - CTO PlayUp - @kevinoneill      YOW! Nights - March 2013
Media Types                 describe a domain                  specific protocolKevin O’Neill - CTO PlayUp - @kevinoneill ...
application/jsonKevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
Media Type ExplosionKevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
Media Types       ":type":	  "application/vnd.playup.ticketing.product+json",	         "product":	  {       	  	  	  	  "d...
Media Types       application/vnd.playup.encrypted+json;embedded=       "application/vnd.playup.ticketing.product.details ...
Media Types       application/vnd.playup.encrypted+json;embedded=       "application/vnd.playup.ticketing.product.details ...
Media Types       application/vnd.playup.encrypted+json;embedded=       "application/vnd.playup.ticketing.product.details ...
Something to considerKevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
Format vs Type       application/vnd.playup.stream+jsonKevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
Format vs Type       application/vnd.playup.stream+jsonKevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
Format vs Type       application/vnd.playup.stream+mpKevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
Format vs Type       application/vnd.playup.stream;format=”json”Kevin O’Neill - CTO PlayUp - @kevinoneill    YOW! Nights -...
So now we postKevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
Offer       {       	  	  	  	  ":type":	  "application/vnd.playup.ticketing.offer+json",	         	  	  	  	  "content":	...
Offer       {       	  	  	  	  ":type":	  "application/vnd.playup.ticketing.offer+json",	         	  	  	  	  "content":	...
Offer       {       	  	  	  	  ":type":	  "application/vnd.playup.ticketing.offer+json",	         	  	  	  	  "content":	...
Tips & TripsKevin O’Neill - CTO PlayUp - @kevinoneill        YOW! Nights - March 2013
API VersioningKevin O’Neill - CTO PlayUp - @kevinoneill    YOW! Nights - March 2013
Versioning       X-­‐PlayUp-­‐API-­‐Version       3Kevin O’Neill - CTO PlayUp - @kevinoneill          YOW! Nights - March ...
Don’t Do ItKevin O’Neill - CTO PlayUp - @kevinoneill           YOW! Nights - March 2013
Server Decides       User-­‐Agent       PlayUp%20Pass/3.5.5233	  CFNetwork/609.1.4	         Darwin/13.0.0Kevin O’Neill - C...
Client Decides       "link":	  {       	  	  ":representations":	  [       	  	  	  	  {       	  	  	  	  	  	  "href":	 ...
Client Decides       "link":	  {       	  	  ":representations":	  [       	  	  	  	  {       	  	  	  	  	  	  "href":	 ...
Client Decides       "link":	  {       	  	  ":representations":	  [       	  	  	  	  {       	  	  	  	  	  	  "href":	 ...
Client vs ServerKevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
Document EvolutionKevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
The client should          ignore what it doesn’t               understandKevin O’Neill - CTO PlayUp - @kevinoneill   YOW!...
Don’t add or remove             mandatory fieldsKevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
New Media TypeKevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
"Realtime" UpdatesKevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
Kevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
XMPPKevin O’Neill - CTO PlayUp - @kevinoneill          YOW! Nights - March 2013
PollingKevin O’Neill - CTO PlayUp - @kevinoneill             YOW! Nights - March 2013
Leverage                              InfrastructureKevin O’Neill - CTO PlayUp - @kevinoneill      YOW! Nights - March 2013
Dynamic ScalingKevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
Cache Headers       ETag       "9461cf5ecc0f4df6e880ce76479aba90"       Cache-­‐Control       max-­‐age=15,	  public      ...
Cache Headers        ETag        "9461cf5ecc0f4df6e880ce76479aba90"    	  	  Cache-­‐Control    	  	  max-­‐age=15,	  publ...
Other ChoicesKevin O’Neill - CTO PlayUp - @kevinoneill    YOW! Nights - March 2013
ToolsKevin O’Neill - CTO PlayUp - @kevinoneill           YOW! Nights - March 2013
CharlesKevin O’Neill - CTO PlayUp - @kevinoneill             YOW! Nights - March 2013
FiddlerKevin O’Neill - CTO PlayUp - @kevinoneill             YOW! Nights - March 2013
Link ConditionerKevin O’Neill - CTO PlayUp - @kevinoneill   YOW! Nights - March 2013
WiresharkKevin O’Neill - CTO PlayUp - @kevinoneill          YOW! Nights - March 2013
Wireshark       rvictl	  -­‐s	  <device	  UDID>       /def/bpf*Kevin O’Neill - CTO PlayUp - @kevinoneill          YOW! Nig...
Questions?       Kevin O’Neill       CTO - PlayUp       @kevinoneill       kevin@playup.comKevin O’Neill - CTO PlayUp - @k...
Upcoming SlideShare
Loading in...5
×

Building Hypermedia API's - YOW! Night - March 2013

421

Published on

Building a client API that allows you to scale and evolve is a delicate task. If your API is intended to be used with mobile devices the problem's of latency, bandwidth uncertain connection state, multiple client versions and capabilities compound the problem. See how PlayUp has used hypermedia (ReST) to power and evolve it's applications on iOS, Android, Windows Phone and Windows 8. See a general overview of the principles that guide development, how the client and the server work, the 'oh I wish we hadn't done that moments' and take a tour of the document exchanges that power PlayUp's ticketing service.

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
421
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
9
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Building Hypermedia API's - YOW! Night - March 2013

  1. 1. YOW!Nights March 2013Kevin O’NeillCTO PlayUp@kevinoneill
  2. 2. Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  3. 3. Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  4. 4. Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  5. 5. Roadmap • ReST and Hypermedia • An example of a Hypermedia driven service • Tips & TripsKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  6. 6. A jumping off pointKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  7. 7. OpinionatedKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  8. 8. RealKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  9. 9. ReST & HypermediaKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  10. 10. Representational State Transfer (ReST) is a style of software architecture for distributed hypermedia systems such as the World Wide WebKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  11. 11. ReSTKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  12. 12. ReST is not a meaningful termKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  13. 13. One URL ≠ ReSTKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  14. 14. One URL ≠ ReST http://example.com/system?action=getUser&uid=3 http://example.com/system?action=mkUser&name=… http://example.com/system?action=rmUser&uid=3Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  15. 15. Resources = ReST ?Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  16. 16. Resources = ReST ? http://example.com/users/3 http://example.com/users/<uid> http://example.com/users/<uid>/friendsKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  17. 17. HTTP Verbs = ReST ?Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  18. 18. HTTP Verbs = ReST ? POST  http://example.com/users GET  http://example.com/users/3 PUT  http://example.com/users/3 DELETE  http://example.com/users/3Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  19. 19. What is ReST really?Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  20. 20. "ReST is software design on the scale of decades: every detail is intended to promote software longevity and independent evolution. Many of the constraints are directly opposed to short-term efficiency. Unfortunately, people are fairly good at short-term design, and usually awful at long-term design." Roy FieldingKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  21. 21. The constraints of ReSTKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  22. 22. Client ServerKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  23. 23. Stateless ServerKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  24. 24. CacheableKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  25. 25. Uniform InterfaceKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  26. 26. Layered SystemKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  27. 27. Code-On-Demand (optional)Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  28. 28. Uniform InterfaceKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  29. 29. Identification of ResourcesKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  30. 30. Manipulation of resources through representationsKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  31. 31. Self-descriptive messagesKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  32. 32. Hypermedia as the engine of application stateKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  33. 33. “What needs to be done to make the ReST architectural style clear on the notion that hypertext is a constraint? In other words, if the engine of application state (and hence the API) is not being driven by hypertext, then it cannot be ReSTful and cannot be a ReST API. Period. Is there some broken manual somewhere that needs to be fixed?” Roy T. FieldingKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  34. 34. A Hypermedia driven serviceKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  35. 35. PlayUp PassKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  36. 36. Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  37. 37. Getting the Price TMS 2 Get Tile 1 Get Section 4 Section 3 Priced Tile 7:20 PM 7 Get Price Content App Provider Store ($) 8$ 5 6 Ticket ServiceKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  38. 38. Products ":type":  "application/vnd.playup.ticketing.product+json",   "product":  {        "detail":  {                ":type":  "application/vnd.playup.encrypted+json",                  "aes256-­‐cbc":  {                        "data":  "  …  ",                          "iv":  "  …  ",                          "key":  "  …  ",                          "signature":  "  …  ",                          "type":  "application/vnd.playup.ticketing.product.detail+json"                }        },          "id":  "82699e9b-­‐b147-­‐46b4-­‐a90c-­‐24316071b6e9",          "name":  "F1  GP  Insider",          "preview":  {                ":href":  "http://april.ticket-­‐provider.playupdev.com/content/82/preview? token={token:ticketing_sample_provider}",                  ":type":  "application/vnd.playup.stream.story+json"        },          "provider":  "ticketing_sample_provider" },   "offer":  {        ":href":  "http://april.ticket.playupdev.com/ticket? provider=ticketing_sample_provider&token={token:ticket_service}",          ":options":  [                "POST"        ]        ":acceptable_types":  [                "application/vnd.playup.encrypted+json;embedded="application/ vnd.playup.ticketing.product.details+json";for="ticket_service""        ],   }Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  39. 39. Products ":type":  "application/vnd.playup.ticketing.product+json",   "product":  {        "detail":  {                ":type":  "application/vnd.playup.encrypted+json",                  "aes256-­‐cbc":  {                        "data":  "  …  ",                          "iv":  "  …  ",                          "key":  "  …  ",                          "signature":  "  …  ",                          "type":  "application/vnd.playup.ticketing.product.detail+json"                }        },          "id":  "82699e9b-­‐b147-­‐46b4-­‐a90c-­‐24316071b6e9",          "name":  "F1  GP  Insider",   ":type":  "application/vnd.playup.ticketing.product+json"        "preview":  {                ":href":  "http://april.ticket-­‐provider.playupdev.com/content/82/preview? token={token:ticketing_sample_provider}",                  ":type":  "application/vnd.playup.stream.story+json"        },          "provider":  "ticketing_sample_provider" },   "offer":  {        ":href":  "http://april.ticket.playupdev.com/ticket? provider=ticketing_sample_provider&token={token:ticket_service}",          ":options":  [                "POST"        ]        ":acceptable_types":  [                "application/vnd.playup.encrypted+json;embedded="application/ vnd.playup.ticketing.product.details+json";for="ticket_service""        ],   }Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  40. 40. Preview ":type":  "application/vnd.playup.ticketing.product+json",   "product":  {        "detail":  {                ":type":  "application/vnd.playup.encrypted+json",                  "aes256-­‐cbc":  {                        "data":  "  …  ",                          "iv":  "  …  ",                          "key":  "  …  ",                          "signature":  "  …  ",   "preview":  {                        "type":  "application/vnd.playup.ticketing.product.detail+json"                }    ":href":  "http://april.ticket-­‐provider.playupdev.com/content/        },          "id":  "82699e9b-­‐b147-­‐46b4-­‐a90c-­‐24316071b6e9",   82/preview?token={token:ticketing_sample_provider}",          "name":  "F1  GP  Insider",          "preview":  {    ":type":  "application/vnd.playup.stream.story+json"                ":href":  "http://april.ticket-­‐provider.playupdev.com/content/82/preview? },   token={token:ticketing_sample_provider}",                  ":type":  "application/vnd.playup.stream.story+json"        },          "provider":  "ticketing_sample_provider" },   "offer":  {        ":href":  "http://april.ticket.playupdev.com/ticket? provider=ticketing_sample_provider&token={token:ticket_service}",          ":options":  [                "POST"        ]        ":acceptable_types":  [                "application/vnd.playup.encrypted+json;embedded="application/ vnd.playup.ticketing.product.details+json";for="ticket_service""        ],   }Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  41. 41. Preview ":type":  "application/vnd.playup.ticketing.product+json",   "product":  {        "detail":  {                ":type":  "application/vnd.playup.encrypted+json",                  "aes256-­‐cbc":  {                        "data":  "  …  ",                          "iv":  "  …  ",                          "key":  "  …  ",                          "signature":  "  …  ",                          "type":  "application/vnd.playup.ticketing.product.detail+json"                }        },          "id":  "82699e9b-­‐b147-­‐46b4-­‐a90c-­‐24316071b6e9",          "name":  "F1  GP  Insider",   ":type":  "application/vnd.playup.stream.story+json"        "preview":  {                ":href":  "http://april.ticket-­‐provider.playupdev.com/content/82/preview? token={token:ticketing_sample_provider}",                  ":type":  "application/vnd.playup.stream.story+json"        },          "provider":  "ticketing_sample_provider" },   "offer":  {        ":href":  "http://april.ticket.playupdev.com/ticket? provider=ticketing_sample_provider&token={token:ticket_service}",          ":options":  [                "POST"        ]        ":acceptable_types":  [                "application/vnd.playup.encrypted+json;embedded="application/ vnd.playup.ticketing.product.details+json";for="ticket_service""        ],   }Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  42. 42. Accept HeaderKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  43. 43. Accept Header Accept application/vnd.playup.stream.story+json,*/*Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  44. 44. Preview ":type":  "application/vnd.playup.ticketing.product+json",   "product":  {        "detail":  {                ":type":  "application/vnd.playup.encrypted+json",                  "aes256-­‐cbc":  {                        "data":  "  …  ",                          "iv":  "  …  ",                          "key":  "  …  ",                          "signature":  "  …  ",                          "type":  "application/vnd.playup.ticketing.product.detail+json"                }        },          "id":  "82699e9b-­‐b147-­‐46b4-­‐a90c-­‐24316071b6e9",   ":href":  "http://april.ticket-­‐provider.playupdev.com/content/        "name":  "F1  GP  Insider",          "preview":  { 82/preview?token={token:ticketing_sample_provider}"                ":href":  "http://april.ticket-­‐provider.playupdev.com/content/82/preview? token={token:ticketing_sample_provider}",                  ":type":  "application/vnd.playup.stream.story+json"        },          "provider":  "ticketing_sample_provider" },   "offer":  {        ":href":  "http://april.ticket.playupdev.com/ticket? provider=ticketing_sample_provider&token={token:ticket_service}",          ":options":  [                "POST"        ]        ":acceptable_types":  [                "application/vnd.playup.encrypted+json;embedded="application/ vnd.playup.ticketing.product.details+json";for="ticket_service""        ],   }Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  45. 45. URI ParameterizationKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  46. 46. URI Parameterization ":type":  "application/vnd.playup.ticketing.product+json",   "product":  {        "detail":  {                ":type":  "application/vnd.playup.encrypted+json",                  "aes256-­‐cbc":  {                        "data":  "  …  ",                          "iv":  "  …  ",                          "key":  "  …  ",                          "signature":  "  …  ",                          "type":  "application/vnd.playup.ticketing.product.detail+json"                }        },          "id":  "82699e9b-­‐b147-­‐46b4-­‐a90c-­‐24316071b6e9",          "name":  "F1  GP  Insider",   {token:ticketing_sample_provider}        "preview":  {                ":href":  "http://april.ticket-­‐provider.playupdev.com/content/82/preview? token={token:ticketing_sample_provider}",                  ":type":  "application/vnd.playup.stream.story+json"        },          "provider":  "ticketing_sample_provider" },   "offer":  {        ":href":  "http://april.ticket.playupdev.com/ticket? provider=ticketing_sample_provider&token={token:ticket_service}",          ":options":  [                "POST"        ]        ":acceptable_types":  [                "application/vnd.playup.encrypted+json;embedded="application/ vnd.playup.ticketing.product.details+json";for="ticket_service""        ],   }Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  47. 47. URI Parameterization http://april.ticket-­‐provider.playupdev.com/content/82/preview? token=ABBr0dVOGRdPpF%2BAqll9sJNJAICWEHK %2BnTngDMzBI5IiABmlstT3RjwIBGkJpUCX3lchMQF3OrGoYyiYHh8zAbc7m %2FhsttbKyBBa%2BiX5hSApeBi1erBw7oJH9LBmk %2B1pfL2zApBDxCZZpJCkT5hScK1Z2g3%2BDhqkrQJTs3PQumbbC9bXJRnENksQhs b %2BNJuFrJ47sAGQBPPXyN0hy40i3J6LcwGMUSFIaR5kIAw3%2BiYyiKgC35rmZzvM YGEeV%2F08YR1ih47aKct5%2Fk0CTbzR06qxi1W11fR3pSMBn3HxqgYPjjMdgsa %2B5PiLv102eTk7kXc4Aqz1VDN2ogqu3qDbzebxdp6OOhnoSKa3jebrV9MOH6IgBR KYfiujq7MNle1xV1LwUQlm3T4BagclibIqOq%2FS1psWo0oZfU1DQW5h2AX %2BLrvF%2BGfgFRiHvaOWBUuq5esY0yqENyjD3Yu8WGq15MTqI36oK5S6hUy %2F0gAlB0rFMU %2BSX4WbuX64yjlKVWV5wr7E3FmaxT7yr98pGq04zKrJv2tn4rpUtcRoc8LrYiK2B doQplYATGBCDgv68p%2FTiislPJv0%2B4hqhO5oAIv7fMa81uy %2F5WMcOjzmmsOgJzua0%2B%2FarXna9I3d0djqJ9fTDSQkM6icwz5u2P %2Btulzwq8UHEgYEFYFGUKyk %2BEXUgre7nttltajpLL3fRqGfrUqyI1NNM1dqGjeDN4zL0YA8KujtSoSWcA%3D %3DKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  48. 48. Offers ":type":  "application/vnd.playup.ticketing.product+json",   "product":  {        "detail":  {                ":type":  "application/vnd.playup.encrypted+json",                  "aes256-­‐cbc":  {                        "data":  "  …  ",                          "iv":  "  …  ",                          "key":  "  …  ",                          "signature":  "  …  ",                          "type":  "application/vnd.playup.ticketing.product.detail+json"                }        },          "id":  "82699e9b-­‐b147-­‐46b4-­‐a90c-­‐24316071b6e9",          "name":  "F1  GP  Insider",          "preview":  {                ":href":  "http://april.ticket-­‐provider.playupdev.com/content/82/preview? token={token:ticketing_sample_provider}",                  ":type":  "application/vnd.playup.stream.story+json"        },          "provider":  "ticketing_sample_provider" },   "offer":  {        ":href":  "http://april.ticket.playupdev.com/ticket? provider=ticketing_sample_provider&token={token:ticket_service}",          ":options":  [                "POST"        ]        ":acceptable_types":  [                "application/vnd.playup.encrypted+json;embedded="application/ vnd.playup.ticketing.product.details+json";for="ticket_service""        ],   }Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  49. 49. Offers ":type":  "application/vnd.playup.ticketing.product+json",   "product":  {        "detail":  {                ":type":  "application/vnd.playup.encrypted+json",                  "aes256-­‐cbc":  {                        "data":  "  …  ",                          "iv":  "  …  ",                          "key":  "  …  ",                          "signature":  "  …  ",                          "type":  "application/vnd.playup.ticketing.product.detail+json"                }        },   ":href":  "http://april.ticket.playupdev.com/ticket?        "id":  "82699e9b-­‐b147-­‐46b4-­‐a90c-­‐24316071b6e9",          "name":  "F1  GP  Insider",   provider=ticketing_sample_provider&token={token:ticket_service}        "preview":  { "                ":href":  "http://april.ticket-­‐provider.playupdev.com/content/82/preview? token={token:ticketing_sample_provider}",                  ":type":  "application/vnd.playup.stream.story+json"        },          "provider":  "ticketing_sample_provider" },   "offer":  {        ":href":  "http://april.ticket.playupdev.com/ticket? provider=ticketing_sample_provider&token={token:ticket_service}",          ":options":  [                "POST"        ]        ":acceptable_types":  [                "application/vnd.playup.encrypted+json;embedded="application/ vnd.playup.ticketing.product.details+json";for="ticket_service""        ],   }Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  50. 50. Offers ":type":  "application/vnd.playup.ticketing.product+json",   "product":  {        "detail":  {                ":type":  "application/vnd.playup.encrypted+json",                  "aes256-­‐cbc":  {                        "data":  "  …  ",                          "iv":  "  …  ",                          "key":  "  …  ",                          "signature":  "  …  ",                          "type":  "application/vnd.playup.ticketing.product.detail+json"                }        },    ":options":  [        "id":  "82699e9b-­‐b147-­‐46b4-­‐a90c-­‐24316071b6e9",   Text        "name":  "F1  GP  Insider",        "POST"        "preview":  {                ":href":  "http://april.ticket-­‐provider.playupdev.com/content/82/preview?  ] token={token:ticketing_sample_provider}",                  ":type":  "application/vnd.playup.stream.story+json"        },          "provider":  "ticketing_sample_provider" },   "offer":  {        ":href":  "http://april.ticket.playupdev.com/ticket? provider=ticketing_sample_provider&token={token:ticket_service}",          ":options":  [                "POST"        ],        ":acceptable_types":  [                "application/vnd.playup.encrypted+json;embedded="application/ vnd.playup.ticketing.product.details+json";for="ticket_service""        ]   }Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  51. 51. Offers ":type":  "application/vnd.playup.ticketing.product+json",   "product":  {        "detail":  {                ":type":  "application/vnd.playup.encrypted+json",                  "aes256-­‐cbc":  {                        "data":  "  …  ",                          "iv":  "  …  ",                          "key":  "  …  ",                          "signature":  "  …  ",   ":acceptable_types":  [                        "type":  "application/vnd.playup.ticketing.product.detail+json"                }  "application/vnd.playup.encrypted+json        },          "id":  "82699e9b-­‐b147-­‐46b4-­‐a90c-­‐24316071b6e9",        ;embedded=        "name":  "F1  GP  Insider",          "preview":  {          "application/vnd.playup.ticketing.product.details+json"                ":href":  "http://april.ticket-­‐provider.playupdev.com/content/82/preview?      ;for="ticket_service"" token={token:ticketing_sample_provider}",                  ":type":  "application/vnd.playup.stream.story+json" ]        },          "provider":  "ticketing_sample_provider" },   "offer":  {        ":href":  "http://april.ticket.playupdev.com/ticket? provider=ticketing_sample_provider&token={token:ticket_service}",          ":options":  [                "POST"        ]        ":acceptable_types":  [                "application/vnd.playup.encrypted+json;embedded="application/ vnd.playup.ticketing.product.details+json";for="ticket_service""        ],   }Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  52. 52. Media TypesKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  53. 53. Media Types describe a domain specific protocolKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  54. 54. application/jsonKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  55. 55. Media Type ExplosionKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  56. 56. Media Types ":type":  "application/vnd.playup.ticketing.product+json",   "product":  {        "detail":  {                ":type":  "application/vnd.playup.encrypted+json",                  "aes256-­‐cbc":  {                        "data":  "  …  ",                          "iv":  "  …  ",                          "key":  "  …  ",                          "signature":  "  …  ",                          "type":  "application/vnd.playup.ticketing.product.detail+json"                }        },          "id":  "82699e9b-­‐b147-­‐46b4-­‐a90c-­‐24316071b6e9",          "name":  "F1  GP  Insider",          "preview":  {                ":href":  "http://april.ticket-­‐provider.playupdev.com/content/82/preview? token={token:ticketing_sample_provider}",                  ":type":  "application/vnd.playup.stream.story+json"        },          "provider":  "ticketing_sample_provider" },   "offer":  {        ":href":  "http://april.ticket.playupdev.com/ticket? provider=ticketing_sample_provider&token={token:ticket_service}",          ":options":  [                "POST"        ]        ":acceptable_types":  [                "application/vnd.playup.encrypted+json;embedded="application/ vnd.playup.ticketing.product.details+json";for="ticket_service""        ],   }Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  57. 57. Media Types application/vnd.playup.encrypted+json;embedded= "application/vnd.playup.ticketing.product.details +json";for="ticket_service"Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  58. 58. Media Types application/vnd.playup.encrypted+json;embedded= "application/vnd.playup.ticketing.product.details +json";for="ticket_service"Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  59. 59. Media Types application/vnd.playup.encrypted+json;embedded= "application/vnd.playup.ticketing.product.details +json";for="ticket_service"Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  60. 60. Something to considerKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  61. 61. Format vs Type application/vnd.playup.stream+jsonKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  62. 62. Format vs Type application/vnd.playup.stream+jsonKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  63. 63. Format vs Type application/vnd.playup.stream+mpKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  64. 64. Format vs Type application/vnd.playup.stream;format=”json”Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  65. 65. So now we postKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  66. 66. Offer {        ":type":  "application/vnd.playup.ticketing.offer+json",          "content":  {                "expiration":  "2015-­‐03-­‐13  01:12:44  +0000",                  "store-­‐product":  [                        {                                "product":  "com.playup.content.pricing.tier1",                                  "vendor":  "appstore"                        }                ]        },          "verification":  {                "key":  "…",                  "link":  {                        ":acceptable_types":  [                                "application/vnd.playup.encrypted+json;embedded="application/ vnd.playup.ticketing.receipt+json";for="ticket_service""                        ],                          ":href":  "http://april.ticket.playupdev.com/receipt?token={token:ticket_service}",                          ":options":  [                                "POST"                        ]                }        } }Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  67. 67. Offer {        ":type":  "application/vnd.playup.ticketing.offer+json",          "content":  {                "expiration":  "2015-­‐03-­‐13  01:12:44  +0000",   "content":  {                "store-­‐product":  [                        {    "expiration":  "2015-­‐03-­‐13  01:12:44  +0000",                                  "product":  "com.playup.content.pricing.tier1",      "store-­‐product":  [                                "vendor":  "appstore"                        }        {                ]        },              "product":  "com.playup.content.pricing.tier1",          "verification":  {            "vendor":  "appstore"                "key":  "…",                  "link":  {        }                        ":acceptable_types":  [                                "application/vnd.playup.encrypted+json;embedded="application/    ] vnd.playup.ticketing.receipt+json";for="ticket_service""                        ],   }                        ":href":  "http://april.ticket.playupdev.com/receipt?token={token:ticket_service}",                          ":options":  [                                "POST"                        ]                }        } }Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  68. 68. Offer {        ":type":  "application/vnd.playup.ticketing.offer+json",          "content":  {                "expiration":  "2015-­‐03-­‐13  01:12:44  +0000",                  "store-­‐product":  [                        { "link":  {                                "product":  "com.playup.content.pricing.tier1",      ":href":  "http://april.ticket.playupdev.com/receipt…",                                  "vendor":  "appstore"                        }    ":options":  [  "POST"  ],                ]        },      ":acceptable_types":  [        "verification":  {        "application/vnd.playup.encrypted+json;…"                "key":  "…",                  "link":  {    ]                        ":acceptable_types":  [                                "application/vnd.playup.encrypted+json;embedded="application/ } vnd.playup.ticketing.receipt+json";for="ticket_service""                        ],                          ":href":  "http://april.ticket.playupdev.com/receipt?token={token:ticket_service}",                          ":options":  [                                "POST"                        ]                }        } }Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  69. 69. Tips & TripsKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  70. 70. API VersioningKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  71. 71. Versioning X-­‐PlayUp-­‐API-­‐Version 3Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  72. 72. Don’t Do ItKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  73. 73. Server Decides User-­‐Agent PlayUp%20Pass/3.5.5233  CFNetwork/609.1.4   Darwin/13.0.0Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  74. 74. Client Decides "link":  {    ":representations":  [        {            "href":  "http://twinstapics.playupdev.com/photos/86/stream  …"  ,              "type":  "application/vnd.playup.stream+json"        },          {              "href":  "http://twinstapics.playupdev.com/photos/86/section  …"    ,              "type":  "text/html"        }    ],      ":self":  "http://twinstapics.playupdev.com/photos/86/section  …",      ":type":  "text/html" },  Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  75. 75. Client Decides "link":  {    ":representations":  [        {            "href":  "http://twinstapics.playupdev.com/photos/86/stream  …"  ,              "type":  "application/vnd.playup.stream+json"        },          {              "href":  "http://twinstapics.playupdev.com/photos/86/section  …"    ,              "type":  "text/html"        }    ],      ":href":  "http://twinstapics.playupdev.com/photos/86/section  …",      ":type":  "text/html" },  Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  76. 76. Client Decides "link":  {    ":representations":  [        {            "href":  "http://twinstapics.playupdev.com/photos/86/stream  …"  ,              "type":  "application/vnd.playup.stream+json"        },          {              "href":  "http://twinstapics.playupdev.com/photos/86/section  …"    ,              "type":  "text/html"        }    ],      ":href":  "http://twinstapics.playupdev.com/photos/86/section  …",      ":type":  "text/html" },  Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  77. 77. Client vs ServerKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  78. 78. Document EvolutionKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  79. 79. The client should ignore what it doesn’t understandKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  80. 80. Don’t add or remove mandatory fieldsKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  81. 81. New Media TypeKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  82. 82. "Realtime" UpdatesKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  83. 83. Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  84. 84. XMPPKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  85. 85. PollingKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  86. 86. Leverage InfrastructureKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  87. 87. Dynamic ScalingKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  88. 88. Cache Headers ETag "9461cf5ecc0f4df6e880ce76479aba90" Cache-­‐Control max-­‐age=15,  public Vary Accept-­‐LanguageKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  89. 89. Cache Headers ETag "9461cf5ecc0f4df6e880ce76479aba90"    Cache-­‐Control    max-­‐age=15,  public Cache-­‐Control max-­‐age=15,  public Vary Accept-­‐LanguageKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  90. 90. Other ChoicesKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  91. 91. ToolsKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  92. 92. CharlesKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  93. 93. FiddlerKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  94. 94. Link ConditionerKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  95. 95. WiresharkKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  96. 96. Wireshark rvictl  -­‐s  <device  UDID> /def/bpf*Kevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013
  97. 97. Questions? Kevin O’Neill CTO - PlayUp @kevinoneill kevin@playup.comKevin O’Neill - CTO PlayUp - @kevinoneill YOW! Nights - March 2013

×