A Day of REST 2016

6ea15b18e25b00e1af953e489439d540?s=47 Ryan McCue
January 28, 2016

A Day of REST 2016

"Introduction to the WP REST API" - A brief history of the REST API plugin.

6ea15b18e25b00e1af953e489439d540?s=128

Ryan McCue

January 28, 2016
Tweet

Transcript

  1. Introduction to the REST API Ryan McCue
 Senior Engineer at

    Human Made
  2. What is the API?

  3. What is the API?

  4. Why is the API? A history of the API

  5. Existing WordPress APIs

  6. XML-RPC Existing APIs & friends Most powerful:

  7. JSON-RPC Existing APIs

  8. Existing APIs

  9. JSON-RPC Existing APIs

  10. admin-ajax Existing APIs & friends Most developer friendly:

  11. RSS Existing APIs & friends Most used:

  12. RSS.js Existing APIs

  13. Existing APIs

  14. RSS.js Existing APIs

  15. The World Wide Web

  16. World Wide Web

  17. None
  18. None
  19. None
  20. None
  21. World Wide Web

  22. None
  23. None
  24. World Wide Web

  25. None
  26. None
  27. WordPress.com API

  28. None
  29. .com API …REST?

  30. None
  31. .com API WordPress.com specifics

  32. None
  33. .com API Inspiration

  34. .com API Unification

  35. Birth of a Plugin

  36. None
  37. JSON

  38. JSON Language Support

  39. None
  40. None
  41. None
  42. JSON Not XML

  43. JSON JSONP

  44. JSON

  45. None
  46. JSON

  47. None
  48. JSON

  49. JSON /**/callback({…

  50. REST

  51. REST Browser Support

  52. REST RPC

  53. REST Challenges

  54. Response Format

  55. Responses Breaking from Core Names

  56. Responses Posts ID => id post_content => content
 post_name =>

    slug
  57. Responses Comments comment_ID => id comment_content => content
 post_name =>

    slug
  58. Responses Terms term_id => id
 name => name slug =>

    slug
  59. Responses Users ID => id
 display_name => name user_nicename =>

    slug
  60. Responses Enveloping

  61. None
  62. Responses $ http demo.wp-api.org/wp-json/v2/wp?_envelope HTTP/1.1 200 OK { "body": {

    "name": "WP API Demo", "description": "Just another WordPress site”, "_links": { ... }, "headers": { "Allow": "GET" }, "status": 200 }
  63. Responses HAL

  64. None
  65. Responses JSON Schema

  66. Infrastructure

  67. Infrastructure Request & Response

  68. Infrastructure Separation of Concerns

  69. Infrastructure REST Server vs Rewrites

  70. Problems

  71. Problems It’s New

  72. Problems Meta

  73. Problems Authentication

  74. Bad / Good?

  75. Help Us!

  76. Thanks. speakerdeck.com/rmccue