Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.

Discovering The WordPress REST API

854 vues

Publié le

WordPress now includes a full featured REST API with default routes for content and the ability for plugins to add additional routes. This provide new ways to read and write data on your WordPress sites that is perfect for use with JavaScript-driven interfaces, apps and more. But do you know what exactly what is available and how to use each route?

Every WordPress site is unique, so every site’s REST API will be different. In this talk you will learn how to use route discovery to learn the answers to each of these questions, for every site.

CalderaForms.com/wclax2017

Publié dans : Logiciels
  • Soyez le premier à commenter

  • Soyez le premier à aimer ceci

Discovering The WordPress REST API

  1. 1. @Josh412 Discovering The WordPress REST API Josh Pollock | CalderaLabs.org
  2. 2. @Josh412 CalderaLabs.org Hi I'm Josh Lead Developer: Caldera Labs Caldera Forms and Caldera Forms Pro Caldera Learn 2 books about WordPress development Core contributor to WordPress Member of The WPCrowd
  3. 3. @Josh412 CalderaLabs.org Hi I'm Josh Download Slides: CalderaForms.com/wclax2017
  4. 4. @Josh412 What We're Covering Today Quick Introduction To The WordPress API Route Discovery How To Learn More REST API AMA
  5. 5. @Josh412 CalderaLearn.com 0. Quick Intro To The WordPress REST API What Is It? Why Is It Exciting? How Does It Work?
  6. 6. @Josh412 CalderaLabs.org What Is The WordPress REST API??
  7. 7. @Josh412 What Is The WordPress REST API? Tools To Build REST APIs RESTful CRUD Custom REST APIs
  8. 8. @Josh412 This Is The WordPress REST API
  9. 9. @Josh412 CRUD Routes For WordPress Content Posts Users Comments Taxonomies Sites
  10. 10. @Josh412 Post Routes /wp/v2/posts First page of posts /wp/v2/posts/42 Post 42 /wp/v2/comments First page of comments
  11. 11. @Josh412 CalderaLearn.com I'm Not Going To Give You A Complete List Of Routes I Can't, Every Site Is Unique
  12. 12. @Josh412 CalderaLearn.com 2. Route Discovery What Is It? How Does It Work?
  13. 13. @Josh412 Rule: REST APIs Should Be Discoverable
  14. 14. @Josh412 The REST API Tells Us What We Can Do With It
  15. 15. @Josh412 CalderaLabs.org You Don't Have To Memorize All These Routes!!
  16. 16. @Josh412 How To Find Routes /wp-json /wp-json/<namespace> _links section of response*
  17. 17. @Josh412 Tools For Exploring APIs Postman REST API Client - Chrome Extension ARC REST API Client - Chrome Extension PAW REST API Client - Desktop App JSONView Pretty printer for JSON - Chrome Extension
  18. 18. @Josh412 /wp-json Name Description URL Home Namespaces Authentication Routes _links
  19. 19. @Josh412 /wp-json
  20. 20. @Josh412 /wp-json : namespaces
  21. 21. @Josh412 /wp-json
  22. 22. @Josh412 /wp-json : Authentication
  23. 23. @Josh412 /wp-json : Routes Every route Where it is Available methods Arguments it accepts
  24. 24. @Josh412 /wp-json : _links
  25. 25. @Josh412 Route Schemas
  26. 26. @Josh412 What Can This Route?
  27. 27. @Josh412 What Can This Route?
  28. 28. @Josh412 What Can This Route?
  29. 29. @Josh412 CalderaLabs.org Discoverability FTW Every WordPress site is unique.
  30. 30. @Josh412 _links
  31. 31. @Josh412 _links
  32. 32. @Josh412 _links
  33. 33. @Josh412 CalderaLabs.org _links == Connections
  34. 34. @Josh412 _links
  35. 35. @Josh412 _links
  36. 36. @Josh412 embeddable
  37. 37. @Josh412 /wp-json/wp/v2/posts/46214?_embed=tru e
  38. 38. @Josh412 ?_embed=true
  39. 39. @Josh412 Use Route Discovery To explore possibilities of a site's API. To write dynamic API clients
  40. 40. @Josh412 CalderaLearn.com 3. How To Learn More What To Learn? Where To Learn?
  41. 41. @Josh412 Keep Discovering
  42. 42. @Josh412 Places To Learn More Caldera Learn CalderaLearn.com JavaScript For WordPress With Zac Gordon JavascriptForWP.com WordPress TV WordPress.tv/?s=rest+api
  43. 43. @Josh412 CalderaLearn.com 4. REST API AMA Ask Me Anything About The WordPress REST API!
  44. 44. CalderaLabs.org Josh Pollock JoshPress.net CalderaForms.com CalderaLearn.com CalderaLabs.org @Josh412
  45. 45. @Josh412 CalderaLabs.org Questions? Slides: CalderaForms.com/wclax2017
  46. 46. @Josh412 CalderaLabs.org Josh Pollock JoshPress.net CalderaForms.com CalderaLabs.org CalderaLearn.com @Josh412

×