WordPress JSON REST API

634b37a53babc18a5bda19722d5b41a3?s=47 Rachel Baker
December 15, 2014

WordPress JSON REST API

#backboneconf

634b37a53babc18a5bda19722d5b41a3?s=128

Rachel Baker

December 15, 2014
Tweet

Transcript

  1. JSON REST API Current challenges and future impact

  2. Rachel Baker @rachelbaker Senior Web Engineer, Lead Developer, JSON REST

    API Project
  3. Democratize Publishing Mission:

  4. USA Today

  5. http://www.vogue.com/

  6. Five Thirty Eight

  7. None
  8. USA Today

  9. Five Thirty Eight

  10. Five Thirty Eight

  11. http://open.nasa.gov/

  12. http://open.nasa.gov/

  13. http://open.nasa.gov/

  14. http://open.nasa.gov/

  15. Powers over 60 million sites Stats: Forbes, 2011

  16. 23.3% of active sites Stats: W3 Techs, December 2014

  17. 4.0 downloaded 29 million times Stats: WordPress.org, December 2014

  18. Multi-functional

  19. User-friendly

  20. Powered by a popular (and hated) language

  21. Backward compatible

  22. Why do we need an API?

  23. We made it to 11.

  24. Relevance for 11 more years.

  25. 69.1% of the web doesn’t use a CMS.

  26. Build new, or iterate on existing features.

  27. None
  28. Continue the mission.

  29. Challenges

  30. 60 million distributed APIs.

  31. Drink.

  32. 11 years late.

  33. Respect privacy expectations.

  34. Secure authentication.

  35. Different hosting environments.

  36. Different WordPress versions.

  37. Extensible with plugins.

  38. Cannot deploy a bug fix.

  39. Still has to be useful.

  40. Quality clients.

  41. Solutions

  42. Drink.

  43. Slow down we have a responsibility to not screw this

    up.
  44. Err on the side of authentication.

  45. Namespaced and versioned routes: wp/1.0/posts pluginname/2.0/events

  46. OAuth1.0a and possibly OAuth2 through WordPress.org.

  47. Educate our community and seek feedback from all communities.

  48. Official client libraries.

  49. Released version 1.0 and encourage everyone to start using it

    now.
  50. Many are already using it in production New York Times

    Wired 10up Bocoup …and more
  51. Future

  52. None
  53. None
  54. None
  55. Backbone-based WordPress “themes”.

  56. Customized Dashboards.

  57. Customized Dashboards.

  58. Front-end (inline) content editing.

  59. Customized Dashboards.

  60. WordPress has been the gateway drug for tens of thousands

    of web developers.
  61. WordPress will be the gateway drug for tens of thousands

    of APIs.
  62. Check it out

  63. Read the Documentation wp-api.org

  64. Install the Plugin github.com/WP-API/WP-API

  65. Get the Schema http://example.com/wp-json/

  66. Build Stuff and Give Feedback Posts ✔ ✔ ✔ ✔

    Pages ✔ ✔ ✔ ✔ Custom Post Types ✔ ✔ ✔ ✔ Post Meta ✔ ✔ ✔ ✔ Media ✔ ✔ ✔ ✔ Comments ✔ ✔ ✔ ✔ Taxonomies/Terms ✔ ✔ ✔ ✔ Users ✔ ✔ ✔ ✔ GET POST PUT DELETE
  67. Thank you github.com/WP-API

  68. STEP ONE READ THE DOCUMENTATION

  69. STEP TWO Install & Activate the Plugin

  70. STEP THREE GET the API ScHEMA http://example.com/wp-json/

  71. STEP THREE GET the API ScHEMA http://example.com/wp-json/

  72. STEP FOUR GET the POSTS COLLECTION http://example.com/wp-json/posts/

  73. http://example.com/wp-json/ STEP FOUR GET the POSTS COLLECTION

  74. STEPs FIVE - Twenty-Two EXPLORE ALL THE POSSIBILITES Posts ✔

    ✔ ✔ ✔ Pages ✔ ✔ ✔ ✔ Custom Post Types ✔ ✔ ✔ ✔ Post Meta ✔ ✔ ✔ ✔ Media ✔ ✔ ✔ ✔ Comments ✔ ✔ ✔ ✔ Taxonomies/Terms ✔ ✔ ✔ ✔ Users ✔ ✔ ✔ ✔ GET POST PUT DELETE
  75. STEP Twenty-THREE - ?? Use the JSON REST API Use

    the JSON REST API plugin in/for a project. Give us feedback.