SlideShare a Scribd company logo
WordPress
JSON REST API
Maine WordPress Meetup, Mar. 16, 2016
@andygagnon
Why Does WordPress Need an API?
Decoupling WordPress Content from Display
Templates, Plugins, Core
Jeff Bezos, Amazon
circa 2002
• All teams will henceforth expose their data and functionality through service interfaces.
• Teams must communicate with each other through these interfaces.
• There will be no other form of interprocess communication allowed: no direct linking, no direct
reads of another team’s data store, no shared-memory model, no back-doors whatsoever. The
only communication allowed is via service interface calls over the network.
• It doesn’t matter what technology they use. HTTP, Corba, Pubsub, custom protocols — doesn’t
matter.
• All service interfaces, without exception, must be designed from the ground up to be
externalizable. That is to say, the team must plan and design to be able to expose the interface
to developers in the outside world. No exceptions.
• Anyone who doesn’t do this will be fired.
• Thank you; have a nice day!
Maine WordPress Meetup JSON REST API, 3/16/2016
1. Build Useful Software
2. Add API
3. Profit
What Does an API Do?
CRUD
90% of web development
REST = REpresentational State Transfer
REST 6 Constraints
• Client - Server
• Stateless
• Uniform Interface
• Caching
• Layered System
• Code on Demand
REST | HTTP API
Verbs
Nouns
Get/Post/Put/Delete
URI
Demo
http://rest.dev/simple.html
JSON
• JavaScript Object Notation
• Open Standard for data
• Key - Value pairs
• Better than XML
• http://json.org
• http://jsonlint.com
• http://jsoneditoronline.org
• JSON View Extension
DEMO YouTube API
http://rest.dev/you-tube-api.html
Demo GitHub
http://api.github.com
WP JSON REST API
• Actions = Verbs (Get, Post, Put, Delete)
• Routes = URI
• Endpoints = Functions, Data returned
WP API
• http://v2.wp-api.org
• https://wordpress.org/plugins/rest-api/
• WP Version 4.4
• Pretty URLs, Save Permalinks
Demo WP API
http://jra.dev/wp-json/wp/v2
Demo PostMan
WP API Common Routes
• Posts
• Pages
• Custom Posts
• Categories
• Tags
• Taxonomies
• Users
• Comments
Demo ?filter[]=
https://codex.wordpress.org/Class_Reference/
WP_Query
Test Data
• https://codex.wordpress.org/Theme_Unit_Test
Demo Ajax Plugin
http://s2.dev/hello-world
Demo JS Theme
http://s2.dev/wp-admin
https://github.com/rachelbaker/wcus-demo
All New
WordPress
Static Sites
Hybrid Display
Single Page Web App
Native Mobile App
CMS x 2
Other Subjects
• Authorization
• OAuth1
• OAuth2, SSL required
• wp-login
• New Routes
• SEO
• Plugins e.g. Gravity Forms, WooCommerce
WordPress Future Growth
• WP API can push WordPress beyond 25%
• The new API is fuel for new creativity
• New developers
WordPress Development
• WP API is a layer of abstraction over PHP/MySQL.
• Agnostic front end, now with JSON support.
• New admin interfaces can also be created e.g.
Calypso
Parting Words
from Matt Mullenwegg
GitHub
https://github.com/andygagnon/Maine-WordPress-Meetup-JSON-REST-API-demo
https://github.com/rachelbaker/wcus-demo
Thanks!
@andygagnon
http://andregagnon.com

More Related Content

PDF
Webservices: connecting Joomla! with other programs.
PDF
WordPress REST API v2: Overview & Exploring
PDF
Node.js to the rescue
PPTX
Blazor - .NET in the Browser!
PPTX
How to build a rest api
KEY
WordPress APIs
PDF
Why use Go for web development?
PDF
Mobile Hybrid Development with WordPress
Webservices: connecting Joomla! with other programs.
WordPress REST API v2: Overview & Exploring
Node.js to the rescue
Blazor - .NET in the Browser!
How to build a rest api
WordPress APIs
Why use Go for web development?
Mobile Hybrid Development with WordPress

What's hot (20)

PDF
A Day of REST
PPTX
JavaScript Build System Battle Royale | PrDC 2017
PDF
WordPress Development Tools and Best Practices
PDF
Improve WordPress performance with caching and deferred execution of code
PDF
Beyond The Browser - Creating a RESTful Web Service With WordPress
PDF
JSON REST API for WordPress
PDF
BeEF_EUSecWest-2012_Michele-Orru
PPTX
Exploring Content API Options - March 23rd 2016
PDF
Speeding up your WordPress Site - WordCamp Toronto 2015
PPTX
WordPress Rest API
PDF
WordPress: Getting Under the Hood
PDF
Fast Web Applications with Go
PDF
Using Composer to create manageable WordPress websites
PDF
WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!
PPTX
What is a good technology stack today?
PPTX
Building modern web sites with ASP .Net Web API, WebSockets and RSignal
PDF
Flask introduction
PDF
Migrate PHP E-Commerce Site to Go
PPTX
Single Page Application
PPTX
Intro to Coldfusion
A Day of REST
JavaScript Build System Battle Royale | PrDC 2017
WordPress Development Tools and Best Practices
Improve WordPress performance with caching and deferred execution of code
Beyond The Browser - Creating a RESTful Web Service With WordPress
JSON REST API for WordPress
BeEF_EUSecWest-2012_Michele-Orru
Exploring Content API Options - March 23rd 2016
Speeding up your WordPress Site - WordCamp Toronto 2015
WordPress Rest API
WordPress: Getting Under the Hood
Fast Web Applications with Go
Using Composer to create manageable WordPress websites
WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!
What is a good technology stack today?
Building modern web sites with ASP .Net Web API, WebSockets and RSignal
Flask introduction
Migrate PHP E-Commerce Site to Go
Single Page Application
Intro to Coldfusion
Ad

Similar to Maine WordPress Meetup JSON REST API, 3/16/2016 (20)

PPTX
Decoupled Architecture and WordPress
PDF
Restful风格ž„web服务架构
PDF
Business Applications Integration In The Cloud
PDF
Node.js
PDF
Intro to CakePHP
PDF
How to Contribute to Apache Usergrid
PPTX
Api crash
PPTX
Api crash
PPTX
Api crash
PPTX
Api crash
PPTX
Api crash
PPTX
Api crash
PPTX
Api crash
PDF
RESTful web
PPTX
Scaling with swagger
KEY
Benefits of an Open environment with Wakanda
PDF
Platforms FTW!
PDF
Platforms FTW!
PPT
Introduction to Google APIs
PDF
Building Awesome APIs with Lumen
Decoupled Architecture and WordPress
Restful风格ž„web服务架构
Business Applications Integration In The Cloud
Node.js
Intro to CakePHP
How to Contribute to Apache Usergrid
Api crash
Api crash
Api crash
Api crash
Api crash
Api crash
Api crash
RESTful web
Scaling with swagger
Benefits of an Open environment with Wakanda
Platforms FTW!
Platforms FTW!
Introduction to Google APIs
Building Awesome APIs with Lumen
Ad

Recently uploaded (20)

PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Digital Strategies for Manufacturing Companies
PDF
System and Network Administration Chapter 2
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
System and Network Administraation Chapter 3
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
Introduction to Artificial Intelligence
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
Transform Your Business with a Software ERP System
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PPTX
L1 - Introduction to python Backend.pptx
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
medical staffing services at VALiNTRY
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Digital Strategies for Manufacturing Companies
System and Network Administration Chapter 2
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
System and Network Administraation Chapter 3
Odoo Companies in India – Driving Business Transformation.pdf
Introduction to Artificial Intelligence
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Odoo POS Development Services by CandidRoot Solutions
Design an Analysis of Algorithms II-SECS-1021-03
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Transform Your Business with a Software ERP System
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
L1 - Introduction to python Backend.pptx
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
How to Choose the Right IT Partner for Your Business in Malaysia
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Operating system designcfffgfgggggggvggggggggg
medical staffing services at VALiNTRY

Maine WordPress Meetup JSON REST API, 3/16/2016