Learning WordPress REST API

A practical tutorial to get you up and running with the revolutionary WordPress REST API

Learning WordPress REST API

This ebook is included in a Mapt subscription
Sufyan bin Uzayr

3 customer reviews
A practical tutorial to get you up and running with the revolutionary WordPress REST API
$0.00
$12.00
$29.99
$29.99p/m after trial
RRP $23.99
RRP $29.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781786469243
Paperback216 pages

Book Description

The WordPress REST API is a recent innovation that has the potential to unlock several new opportunities for WordPress developers. It can help you integrate with technologies outside of WordPress, as well as offer great flexibility when developing themes and plugins for WordPress. As such, the REST API can make developers’ lives easier.

The book begins by covering the basics of the REST API and how it can be used along with WordPress. Learn how the REST API interacts with WordPress, allowing you to copy posts and modify post metadata. Move on to get an understanding of taxonomies and user roles are in WordPress and how to use them with the WordPress REST API. Next, find out how to edit and process forms with AJAX and how to create custom routes and functions. You will create a fully-functional single page web app using a WordPress site and the REST API. Lastly, you will see how to deal with the REST API in future versions and will use it to interact it with third-party services.

By the end of the book, you will be able to work with the WordPress REST API to build web applications.

Table of Contents

Chapter 1: Getting Started with REST API
Introducing REST API
Using REST API in real-world applications
Key considerations when working with REST
Getting started with REST implementation
Using REST in different programming languages
REST API in WordPress
Summary
Chapter 2: Interacting with REST API in WordPress
Getting started
Issuing requests via Postman
HTTP API in WordPress
Fetching GET post output in JSON objects
Interacting REST API via PHP
Issuing POST requests
Summary
Chapter 3: Working with Taxonomies and Users with REST API
Working with taxonomies in WordPress using REST API
Implementing REST API and JavaScript with taxonomies
Working with users in WordPress using REST API
Summary
Chapter 4: Working with Forms Using REST API
Overview
Fundamentals
Setting up the plugin
Summary
Chapter 5: Custom Routes in WordPress REST API
Overview
Adding custom routes to WordPress REST API
Setting up the custom route
Setting up the custom endpoints
Processing requests (and responses)
Summary
Chapter 6: Creating a Simple Web App using WordPress REST API
Overview
Setting up your WordPress site
Steps to disable the default routes
More about WP REST API
The REST architecture
Going further
WP REST API – setting up and using basic authentication
JavaScript authenticated requests
WP HTTP API for authenticated requests
WP REST API - setting up and using advanced authentication
Assessing the availability of the OAuth API
WP REST API - retrieving data
WP REST API: creating and editing posts
WP REST API: internals and customization
Summary
Chapter 7: Mastering REST API for Your Projects
Backward compatibility
A universal API
Architectural structure
REST architectural constraints
Ever-growing REST API
REST API as a platform
REST API in later versions of WordPress
REST API and WordPress plugin development
REST API-based authentication
REST API and security
REST API being used in WordPress plugins
Disabling REST API
Summary
Chapter 8: WordPress REST API in Practice
Key differences between v1 and v2 of the plugin
Internal changes
External changes
Future changes
Functions of APIs
The REST API in theory
A guide to HTTP and REST
The WordPress REST API
The JSON REST API
Developers of WP REST API
REST API revenue sources
Competing architectures on the Web
JavaScript and WordPress
AJAX in WordPress
Things to consider when using REST API
Current status of REST API
Progressive enhancement of WP REST API
WordPress Calypso and the REST API
Securing a REST API
WordPress API and regular users
Building your own API
Drawbacks of a custom API
Custom API tokens
Summary
Chapter 9: Summing It Up
Comparison of REST API with XML-RPC
XML-RPC usage in WordPress
REST API token-based authentication
Making sure your apps and sites are backward-compatible
The future of REST API
Limitations of REST API
Summary

What You Will Learn

  • Use the WordPress REST API to read, write, and edit posts
  • Create and work with metadata using the WordPress REST API
  • Work with taxonomies using the REST API
  • Add custom routes and build apps using the WordPress REST API
  • Process requests and integrate with external applications and frameworks
  • Make your WordPress projects ready for the RESTful API standard

Authors

Table of Contents

Chapter 1: Getting Started with REST API
Introducing REST API
Using REST API in real-world applications
Key considerations when working with REST
Getting started with REST implementation
Using REST in different programming languages
REST API in WordPress
Summary
Chapter 2: Interacting with REST API in WordPress
Getting started
Issuing requests via Postman
HTTP API in WordPress
Fetching GET post output in JSON objects
Interacting REST API via PHP
Issuing POST requests
Summary
Chapter 3: Working with Taxonomies and Users with REST API
Working with taxonomies in WordPress using REST API
Implementing REST API and JavaScript with taxonomies
Working with users in WordPress using REST API
Summary
Chapter 4: Working with Forms Using REST API
Overview
Fundamentals
Setting up the plugin
Summary
Chapter 5: Custom Routes in WordPress REST API
Overview
Adding custom routes to WordPress REST API
Setting up the custom route
Setting up the custom endpoints
Processing requests (and responses)
Summary
Chapter 6: Creating a Simple Web App using WordPress REST API
Overview
Setting up your WordPress site
Steps to disable the default routes
More about WP REST API
The REST architecture
Going further
WP REST API – setting up and using basic authentication
JavaScript authenticated requests
WP HTTP API for authenticated requests
WP REST API - setting up and using advanced authentication
Assessing the availability of the OAuth API
WP REST API - retrieving data
WP REST API: creating and editing posts
WP REST API: internals and customization
Summary
Chapter 7: Mastering REST API for Your Projects
Backward compatibility
A universal API
Architectural structure
REST architectural constraints
Ever-growing REST API
REST API as a platform
REST API in later versions of WordPress
REST API and WordPress plugin development
REST API-based authentication
REST API and security
REST API being used in WordPress plugins
Disabling REST API
Summary
Chapter 8: WordPress REST API in Practice
Key differences between v1 and v2 of the plugin
Internal changes
External changes
Future changes
Functions of APIs
The REST API in theory
A guide to HTTP and REST
The WordPress REST API
The JSON REST API
Developers of WP REST API
REST API revenue sources
Competing architectures on the Web
JavaScript and WordPress
AJAX in WordPress
Things to consider when using REST API
Current status of REST API
Progressive enhancement of WP REST API
WordPress Calypso and the REST API
Securing a REST API
WordPress API and regular users
Building your own API
Drawbacks of a custom API
Custom API tokens
Summary
Chapter 9: Summing It Up
Comparison of REST API with XML-RPC
XML-RPC usage in WordPress
REST API token-based authentication
Making sure your apps and sites are backward-compatible
The future of REST API
Limitations of REST API
Summary

Book Details

ISBN 139781786469243
Paperback216 pages
Read More
From 3 reviews

Read More Reviews