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

WordPress Greek Community - 5th Crete Meetup - Introduction to WordPress REST API - Konstantinos Kouratoras

WordPress Greek Community - 5th Crete Meetup - Introduction to WordPress REST API - Konstantinos Kouratoras

WordPress Greek Community

April 07, 2016
Tweet

More Decks by WordPress Greek Community

Other Decks in Programming

Transcript

  1. Konstantinos Kouratoras - 5th Crete WordPress Meetup - April 2016

    Hello! Tester @ OnTheGoSystems Follow me @kouratoras
  2. Konstantinos Kouratoras - 5th Crete WordPress Meetup - April 2016

    WORDPRESS REST API Application Program Interface
  3. Konstantinos Kouratoras - 5th Crete WordPress Meetup - April 2016

    WORDPRESS REST API REpresentational State Transfer
  4. Konstantinos Kouratoras - 5th Crete WordPress Meetup - April 2016

    • Actions • GET, POST, PUT, DELETE • Resources • GET /posts/ • GET /posts/12 • POST /posts/ • PUT /posts/13 • DELETE /posts/14
  5. Konstantinos Kouratoras - 5th Crete WordPress Meetup - April 2016

    PHP API the_post(), the_content(), the_title(), etc.
  6. Konstantinos Kouratoras - 5th Crete WordPress Meetup - April 2016

    • Javascript • Angular, React, Ember, Backbone, Node,… • Single Page Applications • Better interfaces • Mobile integration • Third party applications
  7. Konstantinos Kouratoras - 5th Crete WordPress Meetup - April 2016

    • JSON API plugin • Ruby on Rails front-end (2009) • WP REST API • Google Summer of Code 2013 • Basic infrastructure in WordPress 4.4 • Full merge in 4.5? 4.6? 4.7?
  8. Konstantinos Kouratoras - 5th Crete WordPress Meetup - April 2016

    • As any other WordPress plugin • Download, install and activate • https://wordpress.org/plugins/rest-api/ • Ready!
  9. Konstantinos Kouratoras - 5th Crete WordPress Meetup - April 2016

    • GET Request • 200 OK • JSON Response • No Authentication
  10. Konstantinos Kouratoras - 5th Crete WordPress Meetup - April 2016

    • /wp-json/posts/ • /wp-json/posts/21433 • /wp-json/pages • /wp-json/taxonomies • /wp-json/comments
  11. Konstantinos Kouratoras - 5th Crete WordPress Meetup - April 2016

    • Authentication • Cookies (Onsite) • Basic Authentication, Application Passwords, OAuth authentication (Offsite)
  12. Konstantinos Kouratoras - 5th Crete WordPress Meetup - April 2016

    • Custom Endpoints • Custom Responses • Custom Content Types • JavaScript/Backbone Client • v2.wp-api.org/extending/javascript-client/
  13. Konstantinos Kouratoras - 5th Crete WordPress Meetup - April 2016

    RESOURCES v2.wp-api.org github.com/WP-API/WP-API wordpress.org/plugins/rest-api