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

Introduction to WordPress REST API

Introduction to WordPress REST API

REST stands for Representational State Transfer. WordPress has several APIs and one of them is the REST API. This API facilitates HTTP Communication with WordPress. This feature is wonderful especially when you consider using WordPress as a back-end facility for your applications.

Benedict Nkeonye

April 05, 2019
Tweet

More Decks by Benedict Nkeonye

Other Decks in Programming

Transcript

  1. Preview • Introduction to APIs • The WordPress REST API

    • Setting Up The WP REST API - Awardspace - Plugins set-up - Testing via Postman • Questions • References
  2. INTRODUCTION TO API(s) An API, or "Application Program Interface", is

    a set of routines and protocols that provide building blocks for computer programmers and web developers to build software applications. APIs allow applications to talk to one another. e.g Twitter APIs, Google Maps API e.t.c
  3. Benefits of API(S) • APIs can help extend the functionality

    of applications • Good APIs can make applications more interactive and enjoyable • For brands that create APIs: the API can be a powerful marketing tool - Increase interest in the coy’s other products - Improve website traffic and brand loyalty
  4. SETTING UP THE WORDPRESS REST API 1. Create a free

    Awardspace account 2. Log in to the WordPress Account created through the process of (1) above. 3. Install the following Plugins - WP REST API V2 (Install & Activate) - JWT Authentication for WP-API (Install only) 4. Configure the hosting platform (Awardspace) - Follow the docs (https://wordpress.org/plugins/jwt-authentication-for-wp-rest-api/) 5. Get posts (via Postman)
  5. References / Extra resources 1. CodeTuts (https://code.tutsplus.com/articles/the-increasing-importance-of-apis-in-web-development--net-22368) 2. Quora (https://www.quora.com/What-is-wordpress-API)

    3. WordPress REST API Handbook (https://developer.wordpress.org/rest-api/) 4. Docs For WP-API Authentication (https://wordpress.org/plugins/jwt-authentication-for-wp-rest-api/) 5. A medium post that captures everything: https://medium.com/@omobolanlearogundade/creating-a-simple-web-app-using-wordpress-rest-api-with-javascript-ab4e3bfa48 98