wordcamp birmingham 2016 - wp api, what is it good for? absolutely everything!

87
WP API, what is it good for? Absolutely Everything! Slides available: https://circlecube.com/does-wordpress/ WordCamp Birmingham - 29 October 2016

Upload: evan-mullins

Post on 09-Jan-2017

97 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

WP API what is it good for

Absolutely Everything

Slides available httpscirclecubecomdoes-wordpress

WordCamp Birmingham - 29 October 2016

IntroductionsEvan Mullins

Lead Web Developer

Brown Bag Marketing

circlecube

circlecubecom

WordPress user since 2006

Full-time web developer since 2007

API

An (API) is a set of

subroutine definitions protocols and tools for building software and applications A

good API makes it easier to develop a program by providing all the building blocks

which are then put together by the programmer

An API is best thought of as a contract provided by one piece of software to another

And growing

October 2016 hits 16000 apis

REST

It describes how one system can communicate state with another One example would

be the state of a product (its name description etc) represented as JSON The

generalised idea of state is termed a resource

JSON

is a lightweight data-interchange format

It is easy for humans to read and write It is easy for machines to parse and generate It

is a text format that is completely language independent but uses conventions that are

familiar to programmers These properties make JSON an ideal data-interchange

language

JSON is built on two structures

A collection of namevalue pairs (object)

An ordered list of values (array)

WP REST API

WordPress is moving towards becoming a fully-fledged application framework and we need new APIs

This project was born to create an easy-to-use easy-to-understand and well-tested framework for creating these APIs plus creating APIs for core

This plugin provides an easy to use REST API available via HTTP

Grab your sitersquos data in simple JSON format including users posts taxonomies and more

Retrieving or updating data is as simple as sending a HTTP request

Want to get your sitersquos posts

Simply send a GET request to

Update user with ID 4

Send a POST request to

wp-jsonwpv2users4

Get all posts with the search term ldquoawesomerdquo

GET

wp-jsonwpv2postssearch=awesome

Itrsquos that easy

The API exposes a simple yet easy interface to WP Query the posts API post meta API users API revisions API and many more

Chances are if you can do it with WordPress WP API will let you do it

Whatrsquos with the V2

A little historyRyan McCue started development on an API and then proposed a WordPress JSON

REST API Project for GSOC in April 2013 (when WordPress was on version 35)

Version 20 of the plugin rebuilt the first with lessons learned The infrastructure

merged into WordPress core in version 44 (December 2015)

A little historyAlthough it was proposed for 45 the

merge was delayed in order to build it out

with more endpoints The REST API is

slated for inclusion in 47 after

considerable discussion and planning

Authentication and further integration

with core will be a focus of 48

Until 47 when this is officially merged into

core (December-ish 2016) wersquoll need to

install the REST API feature Plugin

It about to be realDid you catch that

The REST API merging into

WordPress core

In 47

Thatrsquos a big deal

WPRESTAPIPlugin(for now)

Resources

httpsgithubcomWP-APIWP-API

Resources

httpv2wp-apiorg

Slack Channel

Get Started Today Post 471 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

1 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

InstallThePlugin

Need to do this

until the API

endpoints are

merged into core

NutshellSo in a nutshell rather than getting your content or data via a

webpage as part of a website with php html css and javascript

you can use whatever you want and retrieve your data via the

API Yoursquoll get json data that is compact and fast to transfer and

then you can do endless things with it Create an app load it into

another website analyze it as datahellip itrsquos a great step for

WordPress and a great step to continuing democratizing the web

ToolsPostman -

HTTP or

API client

Also REST Easy for Firefox or httpie for the command line

Back to WordPressThe pluginAPI exposes your data in JSON format in the following content types

Posts

Pages

Media

Custom Post Types

Post Meta

Revisions

Comments

Terms

Users

Routes EndpointsEndpoints are functions available through the API and are simply urls This can be

things like retrieving the API index updating a post or deleting a comment Endpoints

perform a specific function taking some number of parameters and return data to the

client

A route is the ldquonamerdquo you use to access endpoints used in the URL A route can have

multiple endpoints associated with it and which is used depends on the HTTP verb

Routes Endpoints ExampleWith the URL

The ldquorouterdquo is (the route doesnrsquot include wp-json because wp-json

is the base path for the API itself)

This route has 3 endpoints

triggers a get_item method returning the post data to the client

triggers an update_item method taking the data to update and returning the

updated post data

triggers a delete_item method returning the now-deleted post data to the

client

get list of latest posts

retrieve a single post

GET - to read data

Standard arguments as yoursquod expect and more

etc

GET

PUT - to create or update data create post

update existing post

DELETE - to trash

Authentication

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 2: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

IntroductionsEvan Mullins

Lead Web Developer

Brown Bag Marketing

circlecube

circlecubecom

WordPress user since 2006

Full-time web developer since 2007

API

An (API) is a set of

subroutine definitions protocols and tools for building software and applications A

good API makes it easier to develop a program by providing all the building blocks

which are then put together by the programmer

An API is best thought of as a contract provided by one piece of software to another

And growing

October 2016 hits 16000 apis

REST

It describes how one system can communicate state with another One example would

be the state of a product (its name description etc) represented as JSON The

generalised idea of state is termed a resource

JSON

is a lightweight data-interchange format

It is easy for humans to read and write It is easy for machines to parse and generate It

is a text format that is completely language independent but uses conventions that are

familiar to programmers These properties make JSON an ideal data-interchange

language

JSON is built on two structures

A collection of namevalue pairs (object)

An ordered list of values (array)

WP REST API

WordPress is moving towards becoming a fully-fledged application framework and we need new APIs

This project was born to create an easy-to-use easy-to-understand and well-tested framework for creating these APIs plus creating APIs for core

This plugin provides an easy to use REST API available via HTTP

Grab your sitersquos data in simple JSON format including users posts taxonomies and more

Retrieving or updating data is as simple as sending a HTTP request

Want to get your sitersquos posts

Simply send a GET request to

Update user with ID 4

Send a POST request to

wp-jsonwpv2users4

Get all posts with the search term ldquoawesomerdquo

GET

wp-jsonwpv2postssearch=awesome

Itrsquos that easy

The API exposes a simple yet easy interface to WP Query the posts API post meta API users API revisions API and many more

Chances are if you can do it with WordPress WP API will let you do it

Whatrsquos with the V2

A little historyRyan McCue started development on an API and then proposed a WordPress JSON

REST API Project for GSOC in April 2013 (when WordPress was on version 35)

Version 20 of the plugin rebuilt the first with lessons learned The infrastructure

merged into WordPress core in version 44 (December 2015)

A little historyAlthough it was proposed for 45 the

merge was delayed in order to build it out

with more endpoints The REST API is

slated for inclusion in 47 after

considerable discussion and planning

Authentication and further integration

with core will be a focus of 48

Until 47 when this is officially merged into

core (December-ish 2016) wersquoll need to

install the REST API feature Plugin

It about to be realDid you catch that

The REST API merging into

WordPress core

In 47

Thatrsquos a big deal

WPRESTAPIPlugin(for now)

Resources

httpsgithubcomWP-APIWP-API

Resources

httpv2wp-apiorg

Slack Channel

Get Started Today Post 471 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

1 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

InstallThePlugin

Need to do this

until the API

endpoints are

merged into core

NutshellSo in a nutshell rather than getting your content or data via a

webpage as part of a website with php html css and javascript

you can use whatever you want and retrieve your data via the

API Yoursquoll get json data that is compact and fast to transfer and

then you can do endless things with it Create an app load it into

another website analyze it as datahellip itrsquos a great step for

WordPress and a great step to continuing democratizing the web

ToolsPostman -

HTTP or

API client

Also REST Easy for Firefox or httpie for the command line

Back to WordPressThe pluginAPI exposes your data in JSON format in the following content types

Posts

Pages

Media

Custom Post Types

Post Meta

Revisions

Comments

Terms

Users

Routes EndpointsEndpoints are functions available through the API and are simply urls This can be

things like retrieving the API index updating a post or deleting a comment Endpoints

perform a specific function taking some number of parameters and return data to the

client

A route is the ldquonamerdquo you use to access endpoints used in the URL A route can have

multiple endpoints associated with it and which is used depends on the HTTP verb

Routes Endpoints ExampleWith the URL

The ldquorouterdquo is (the route doesnrsquot include wp-json because wp-json

is the base path for the API itself)

This route has 3 endpoints

triggers a get_item method returning the post data to the client

triggers an update_item method taking the data to update and returning the

updated post data

triggers a delete_item method returning the now-deleted post data to the

client

get list of latest posts

retrieve a single post

GET - to read data

Standard arguments as yoursquod expect and more

etc

GET

PUT - to create or update data create post

update existing post

DELETE - to trash

Authentication

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 3: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

API

An (API) is a set of

subroutine definitions protocols and tools for building software and applications A

good API makes it easier to develop a program by providing all the building blocks

which are then put together by the programmer

An API is best thought of as a contract provided by one piece of software to another

And growing

October 2016 hits 16000 apis

REST

It describes how one system can communicate state with another One example would

be the state of a product (its name description etc) represented as JSON The

generalised idea of state is termed a resource

JSON

is a lightweight data-interchange format

It is easy for humans to read and write It is easy for machines to parse and generate It

is a text format that is completely language independent but uses conventions that are

familiar to programmers These properties make JSON an ideal data-interchange

language

JSON is built on two structures

A collection of namevalue pairs (object)

An ordered list of values (array)

WP REST API

WordPress is moving towards becoming a fully-fledged application framework and we need new APIs

This project was born to create an easy-to-use easy-to-understand and well-tested framework for creating these APIs plus creating APIs for core

This plugin provides an easy to use REST API available via HTTP

Grab your sitersquos data in simple JSON format including users posts taxonomies and more

Retrieving or updating data is as simple as sending a HTTP request

Want to get your sitersquos posts

Simply send a GET request to

Update user with ID 4

Send a POST request to

wp-jsonwpv2users4

Get all posts with the search term ldquoawesomerdquo

GET

wp-jsonwpv2postssearch=awesome

Itrsquos that easy

The API exposes a simple yet easy interface to WP Query the posts API post meta API users API revisions API and many more

Chances are if you can do it with WordPress WP API will let you do it

Whatrsquos with the V2

A little historyRyan McCue started development on an API and then proposed a WordPress JSON

REST API Project for GSOC in April 2013 (when WordPress was on version 35)

Version 20 of the plugin rebuilt the first with lessons learned The infrastructure

merged into WordPress core in version 44 (December 2015)

A little historyAlthough it was proposed for 45 the

merge was delayed in order to build it out

with more endpoints The REST API is

slated for inclusion in 47 after

considerable discussion and planning

Authentication and further integration

with core will be a focus of 48

Until 47 when this is officially merged into

core (December-ish 2016) wersquoll need to

install the REST API feature Plugin

It about to be realDid you catch that

The REST API merging into

WordPress core

In 47

Thatrsquos a big deal

WPRESTAPIPlugin(for now)

Resources

httpsgithubcomWP-APIWP-API

Resources

httpv2wp-apiorg

Slack Channel

Get Started Today Post 471 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

1 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

InstallThePlugin

Need to do this

until the API

endpoints are

merged into core

NutshellSo in a nutshell rather than getting your content or data via a

webpage as part of a website with php html css and javascript

you can use whatever you want and retrieve your data via the

API Yoursquoll get json data that is compact and fast to transfer and

then you can do endless things with it Create an app load it into

another website analyze it as datahellip itrsquos a great step for

WordPress and a great step to continuing democratizing the web

ToolsPostman -

HTTP or

API client

Also REST Easy for Firefox or httpie for the command line

Back to WordPressThe pluginAPI exposes your data in JSON format in the following content types

Posts

Pages

Media

Custom Post Types

Post Meta

Revisions

Comments

Terms

Users

Routes EndpointsEndpoints are functions available through the API and are simply urls This can be

things like retrieving the API index updating a post or deleting a comment Endpoints

perform a specific function taking some number of parameters and return data to the

client

A route is the ldquonamerdquo you use to access endpoints used in the URL A route can have

multiple endpoints associated with it and which is used depends on the HTTP verb

Routes Endpoints ExampleWith the URL

The ldquorouterdquo is (the route doesnrsquot include wp-json because wp-json

is the base path for the API itself)

This route has 3 endpoints

triggers a get_item method returning the post data to the client

triggers an update_item method taking the data to update and returning the

updated post data

triggers a delete_item method returning the now-deleted post data to the

client

get list of latest posts

retrieve a single post

GET - to read data

Standard arguments as yoursquod expect and more

etc

GET

PUT - to create or update data create post

update existing post

DELETE - to trash

Authentication

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 4: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

And growing

October 2016 hits 16000 apis

REST

It describes how one system can communicate state with another One example would

be the state of a product (its name description etc) represented as JSON The

generalised idea of state is termed a resource

JSON

is a lightweight data-interchange format

It is easy for humans to read and write It is easy for machines to parse and generate It

is a text format that is completely language independent but uses conventions that are

familiar to programmers These properties make JSON an ideal data-interchange

language

JSON is built on two structures

A collection of namevalue pairs (object)

An ordered list of values (array)

WP REST API

WordPress is moving towards becoming a fully-fledged application framework and we need new APIs

This project was born to create an easy-to-use easy-to-understand and well-tested framework for creating these APIs plus creating APIs for core

This plugin provides an easy to use REST API available via HTTP

Grab your sitersquos data in simple JSON format including users posts taxonomies and more

Retrieving or updating data is as simple as sending a HTTP request

Want to get your sitersquos posts

Simply send a GET request to

Update user with ID 4

Send a POST request to

wp-jsonwpv2users4

Get all posts with the search term ldquoawesomerdquo

GET

wp-jsonwpv2postssearch=awesome

Itrsquos that easy

The API exposes a simple yet easy interface to WP Query the posts API post meta API users API revisions API and many more

Chances are if you can do it with WordPress WP API will let you do it

Whatrsquos with the V2

A little historyRyan McCue started development on an API and then proposed a WordPress JSON

REST API Project for GSOC in April 2013 (when WordPress was on version 35)

Version 20 of the plugin rebuilt the first with lessons learned The infrastructure

merged into WordPress core in version 44 (December 2015)

A little historyAlthough it was proposed for 45 the

merge was delayed in order to build it out

with more endpoints The REST API is

slated for inclusion in 47 after

considerable discussion and planning

Authentication and further integration

with core will be a focus of 48

Until 47 when this is officially merged into

core (December-ish 2016) wersquoll need to

install the REST API feature Plugin

It about to be realDid you catch that

The REST API merging into

WordPress core

In 47

Thatrsquos a big deal

WPRESTAPIPlugin(for now)

Resources

httpsgithubcomWP-APIWP-API

Resources

httpv2wp-apiorg

Slack Channel

Get Started Today Post 471 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

1 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

InstallThePlugin

Need to do this

until the API

endpoints are

merged into core

NutshellSo in a nutshell rather than getting your content or data via a

webpage as part of a website with php html css and javascript

you can use whatever you want and retrieve your data via the

API Yoursquoll get json data that is compact and fast to transfer and

then you can do endless things with it Create an app load it into

another website analyze it as datahellip itrsquos a great step for

WordPress and a great step to continuing democratizing the web

ToolsPostman -

HTTP or

API client

Also REST Easy for Firefox or httpie for the command line

Back to WordPressThe pluginAPI exposes your data in JSON format in the following content types

Posts

Pages

Media

Custom Post Types

Post Meta

Revisions

Comments

Terms

Users

Routes EndpointsEndpoints are functions available through the API and are simply urls This can be

things like retrieving the API index updating a post or deleting a comment Endpoints

perform a specific function taking some number of parameters and return data to the

client

A route is the ldquonamerdquo you use to access endpoints used in the URL A route can have

multiple endpoints associated with it and which is used depends on the HTTP verb

Routes Endpoints ExampleWith the URL

The ldquorouterdquo is (the route doesnrsquot include wp-json because wp-json

is the base path for the API itself)

This route has 3 endpoints

triggers a get_item method returning the post data to the client

triggers an update_item method taking the data to update and returning the

updated post data

triggers a delete_item method returning the now-deleted post data to the

client

get list of latest posts

retrieve a single post

GET - to read data

Standard arguments as yoursquod expect and more

etc

GET

PUT - to create or update data create post

update existing post

DELETE - to trash

Authentication

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 5: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

REST

It describes how one system can communicate state with another One example would

be the state of a product (its name description etc) represented as JSON The

generalised idea of state is termed a resource

JSON

is a lightweight data-interchange format

It is easy for humans to read and write It is easy for machines to parse and generate It

is a text format that is completely language independent but uses conventions that are

familiar to programmers These properties make JSON an ideal data-interchange

language

JSON is built on two structures

A collection of namevalue pairs (object)

An ordered list of values (array)

WP REST API

WordPress is moving towards becoming a fully-fledged application framework and we need new APIs

This project was born to create an easy-to-use easy-to-understand and well-tested framework for creating these APIs plus creating APIs for core

This plugin provides an easy to use REST API available via HTTP

Grab your sitersquos data in simple JSON format including users posts taxonomies and more

Retrieving or updating data is as simple as sending a HTTP request

Want to get your sitersquos posts

Simply send a GET request to

Update user with ID 4

Send a POST request to

wp-jsonwpv2users4

Get all posts with the search term ldquoawesomerdquo

GET

wp-jsonwpv2postssearch=awesome

Itrsquos that easy

The API exposes a simple yet easy interface to WP Query the posts API post meta API users API revisions API and many more

Chances are if you can do it with WordPress WP API will let you do it

Whatrsquos with the V2

A little historyRyan McCue started development on an API and then proposed a WordPress JSON

REST API Project for GSOC in April 2013 (when WordPress was on version 35)

Version 20 of the plugin rebuilt the first with lessons learned The infrastructure

merged into WordPress core in version 44 (December 2015)

A little historyAlthough it was proposed for 45 the

merge was delayed in order to build it out

with more endpoints The REST API is

slated for inclusion in 47 after

considerable discussion and planning

Authentication and further integration

with core will be a focus of 48

Until 47 when this is officially merged into

core (December-ish 2016) wersquoll need to

install the REST API feature Plugin

It about to be realDid you catch that

The REST API merging into

WordPress core

In 47

Thatrsquos a big deal

WPRESTAPIPlugin(for now)

Resources

httpsgithubcomWP-APIWP-API

Resources

httpv2wp-apiorg

Slack Channel

Get Started Today Post 471 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

1 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

InstallThePlugin

Need to do this

until the API

endpoints are

merged into core

NutshellSo in a nutshell rather than getting your content or data via a

webpage as part of a website with php html css and javascript

you can use whatever you want and retrieve your data via the

API Yoursquoll get json data that is compact and fast to transfer and

then you can do endless things with it Create an app load it into

another website analyze it as datahellip itrsquos a great step for

WordPress and a great step to continuing democratizing the web

ToolsPostman -

HTTP or

API client

Also REST Easy for Firefox or httpie for the command line

Back to WordPressThe pluginAPI exposes your data in JSON format in the following content types

Posts

Pages

Media

Custom Post Types

Post Meta

Revisions

Comments

Terms

Users

Routes EndpointsEndpoints are functions available through the API and are simply urls This can be

things like retrieving the API index updating a post or deleting a comment Endpoints

perform a specific function taking some number of parameters and return data to the

client

A route is the ldquonamerdquo you use to access endpoints used in the URL A route can have

multiple endpoints associated with it and which is used depends on the HTTP verb

Routes Endpoints ExampleWith the URL

The ldquorouterdquo is (the route doesnrsquot include wp-json because wp-json

is the base path for the API itself)

This route has 3 endpoints

triggers a get_item method returning the post data to the client

triggers an update_item method taking the data to update and returning the

updated post data

triggers a delete_item method returning the now-deleted post data to the

client

get list of latest posts

retrieve a single post

GET - to read data

Standard arguments as yoursquod expect and more

etc

GET

PUT - to create or update data create post

update existing post

DELETE - to trash

Authentication

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 6: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

JSON

is a lightweight data-interchange format

It is easy for humans to read and write It is easy for machines to parse and generate It

is a text format that is completely language independent but uses conventions that are

familiar to programmers These properties make JSON an ideal data-interchange

language

JSON is built on two structures

A collection of namevalue pairs (object)

An ordered list of values (array)

WP REST API

WordPress is moving towards becoming a fully-fledged application framework and we need new APIs

This project was born to create an easy-to-use easy-to-understand and well-tested framework for creating these APIs plus creating APIs for core

This plugin provides an easy to use REST API available via HTTP

Grab your sitersquos data in simple JSON format including users posts taxonomies and more

Retrieving or updating data is as simple as sending a HTTP request

Want to get your sitersquos posts

Simply send a GET request to

Update user with ID 4

Send a POST request to

wp-jsonwpv2users4

Get all posts with the search term ldquoawesomerdquo

GET

wp-jsonwpv2postssearch=awesome

Itrsquos that easy

The API exposes a simple yet easy interface to WP Query the posts API post meta API users API revisions API and many more

Chances are if you can do it with WordPress WP API will let you do it

Whatrsquos with the V2

A little historyRyan McCue started development on an API and then proposed a WordPress JSON

REST API Project for GSOC in April 2013 (when WordPress was on version 35)

Version 20 of the plugin rebuilt the first with lessons learned The infrastructure

merged into WordPress core in version 44 (December 2015)

A little historyAlthough it was proposed for 45 the

merge was delayed in order to build it out

with more endpoints The REST API is

slated for inclusion in 47 after

considerable discussion and planning

Authentication and further integration

with core will be a focus of 48

Until 47 when this is officially merged into

core (December-ish 2016) wersquoll need to

install the REST API feature Plugin

It about to be realDid you catch that

The REST API merging into

WordPress core

In 47

Thatrsquos a big deal

WPRESTAPIPlugin(for now)

Resources

httpsgithubcomWP-APIWP-API

Resources

httpv2wp-apiorg

Slack Channel

Get Started Today Post 471 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

1 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

InstallThePlugin

Need to do this

until the API

endpoints are

merged into core

NutshellSo in a nutshell rather than getting your content or data via a

webpage as part of a website with php html css and javascript

you can use whatever you want and retrieve your data via the

API Yoursquoll get json data that is compact and fast to transfer and

then you can do endless things with it Create an app load it into

another website analyze it as datahellip itrsquos a great step for

WordPress and a great step to continuing democratizing the web

ToolsPostman -

HTTP or

API client

Also REST Easy for Firefox or httpie for the command line

Back to WordPressThe pluginAPI exposes your data in JSON format in the following content types

Posts

Pages

Media

Custom Post Types

Post Meta

Revisions

Comments

Terms

Users

Routes EndpointsEndpoints are functions available through the API and are simply urls This can be

things like retrieving the API index updating a post or deleting a comment Endpoints

perform a specific function taking some number of parameters and return data to the

client

A route is the ldquonamerdquo you use to access endpoints used in the URL A route can have

multiple endpoints associated with it and which is used depends on the HTTP verb

Routes Endpoints ExampleWith the URL

The ldquorouterdquo is (the route doesnrsquot include wp-json because wp-json

is the base path for the API itself)

This route has 3 endpoints

triggers a get_item method returning the post data to the client

triggers an update_item method taking the data to update and returning the

updated post data

triggers a delete_item method returning the now-deleted post data to the

client

get list of latest posts

retrieve a single post

GET - to read data

Standard arguments as yoursquod expect and more

etc

GET

PUT - to create or update data create post

update existing post

DELETE - to trash

Authentication

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 7: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

WP REST API

WordPress is moving towards becoming a fully-fledged application framework and we need new APIs

This project was born to create an easy-to-use easy-to-understand and well-tested framework for creating these APIs plus creating APIs for core

This plugin provides an easy to use REST API available via HTTP

Grab your sitersquos data in simple JSON format including users posts taxonomies and more

Retrieving or updating data is as simple as sending a HTTP request

Want to get your sitersquos posts

Simply send a GET request to

Update user with ID 4

Send a POST request to

wp-jsonwpv2users4

Get all posts with the search term ldquoawesomerdquo

GET

wp-jsonwpv2postssearch=awesome

Itrsquos that easy

The API exposes a simple yet easy interface to WP Query the posts API post meta API users API revisions API and many more

Chances are if you can do it with WordPress WP API will let you do it

Whatrsquos with the V2

A little historyRyan McCue started development on an API and then proposed a WordPress JSON

REST API Project for GSOC in April 2013 (when WordPress was on version 35)

Version 20 of the plugin rebuilt the first with lessons learned The infrastructure

merged into WordPress core in version 44 (December 2015)

A little historyAlthough it was proposed for 45 the

merge was delayed in order to build it out

with more endpoints The REST API is

slated for inclusion in 47 after

considerable discussion and planning

Authentication and further integration

with core will be a focus of 48

Until 47 when this is officially merged into

core (December-ish 2016) wersquoll need to

install the REST API feature Plugin

It about to be realDid you catch that

The REST API merging into

WordPress core

In 47

Thatrsquos a big deal

WPRESTAPIPlugin(for now)

Resources

httpsgithubcomWP-APIWP-API

Resources

httpv2wp-apiorg

Slack Channel

Get Started Today Post 471 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

1 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

InstallThePlugin

Need to do this

until the API

endpoints are

merged into core

NutshellSo in a nutshell rather than getting your content or data via a

webpage as part of a website with php html css and javascript

you can use whatever you want and retrieve your data via the

API Yoursquoll get json data that is compact and fast to transfer and

then you can do endless things with it Create an app load it into

another website analyze it as datahellip itrsquos a great step for

WordPress and a great step to continuing democratizing the web

ToolsPostman -

HTTP or

API client

Also REST Easy for Firefox or httpie for the command line

Back to WordPressThe pluginAPI exposes your data in JSON format in the following content types

Posts

Pages

Media

Custom Post Types

Post Meta

Revisions

Comments

Terms

Users

Routes EndpointsEndpoints are functions available through the API and are simply urls This can be

things like retrieving the API index updating a post or deleting a comment Endpoints

perform a specific function taking some number of parameters and return data to the

client

A route is the ldquonamerdquo you use to access endpoints used in the URL A route can have

multiple endpoints associated with it and which is used depends on the HTTP verb

Routes Endpoints ExampleWith the URL

The ldquorouterdquo is (the route doesnrsquot include wp-json because wp-json

is the base path for the API itself)

This route has 3 endpoints

triggers a get_item method returning the post data to the client

triggers an update_item method taking the data to update and returning the

updated post data

triggers a delete_item method returning the now-deleted post data to the

client

get list of latest posts

retrieve a single post

GET - to read data

Standard arguments as yoursquod expect and more

etc

GET

PUT - to create or update data create post

update existing post

DELETE - to trash

Authentication

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 8: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

WordPress is moving towards becoming a fully-fledged application framework and we need new APIs

This project was born to create an easy-to-use easy-to-understand and well-tested framework for creating these APIs plus creating APIs for core

This plugin provides an easy to use REST API available via HTTP

Grab your sitersquos data in simple JSON format including users posts taxonomies and more

Retrieving or updating data is as simple as sending a HTTP request

Want to get your sitersquos posts

Simply send a GET request to

Update user with ID 4

Send a POST request to

wp-jsonwpv2users4

Get all posts with the search term ldquoawesomerdquo

GET

wp-jsonwpv2postssearch=awesome

Itrsquos that easy

The API exposes a simple yet easy interface to WP Query the posts API post meta API users API revisions API and many more

Chances are if you can do it with WordPress WP API will let you do it

Whatrsquos with the V2

A little historyRyan McCue started development on an API and then proposed a WordPress JSON

REST API Project for GSOC in April 2013 (when WordPress was on version 35)

Version 20 of the plugin rebuilt the first with lessons learned The infrastructure

merged into WordPress core in version 44 (December 2015)

A little historyAlthough it was proposed for 45 the

merge was delayed in order to build it out

with more endpoints The REST API is

slated for inclusion in 47 after

considerable discussion and planning

Authentication and further integration

with core will be a focus of 48

Until 47 when this is officially merged into

core (December-ish 2016) wersquoll need to

install the REST API feature Plugin

It about to be realDid you catch that

The REST API merging into

WordPress core

In 47

Thatrsquos a big deal

WPRESTAPIPlugin(for now)

Resources

httpsgithubcomWP-APIWP-API

Resources

httpv2wp-apiorg

Slack Channel

Get Started Today Post 471 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

1 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

InstallThePlugin

Need to do this

until the API

endpoints are

merged into core

NutshellSo in a nutshell rather than getting your content or data via a

webpage as part of a website with php html css and javascript

you can use whatever you want and retrieve your data via the

API Yoursquoll get json data that is compact and fast to transfer and

then you can do endless things with it Create an app load it into

another website analyze it as datahellip itrsquos a great step for

WordPress and a great step to continuing democratizing the web

ToolsPostman -

HTTP or

API client

Also REST Easy for Firefox or httpie for the command line

Back to WordPressThe pluginAPI exposes your data in JSON format in the following content types

Posts

Pages

Media

Custom Post Types

Post Meta

Revisions

Comments

Terms

Users

Routes EndpointsEndpoints are functions available through the API and are simply urls This can be

things like retrieving the API index updating a post or deleting a comment Endpoints

perform a specific function taking some number of parameters and return data to the

client

A route is the ldquonamerdquo you use to access endpoints used in the URL A route can have

multiple endpoints associated with it and which is used depends on the HTTP verb

Routes Endpoints ExampleWith the URL

The ldquorouterdquo is (the route doesnrsquot include wp-json because wp-json

is the base path for the API itself)

This route has 3 endpoints

triggers a get_item method returning the post data to the client

triggers an update_item method taking the data to update and returning the

updated post data

triggers a delete_item method returning the now-deleted post data to the

client

get list of latest posts

retrieve a single post

GET - to read data

Standard arguments as yoursquod expect and more

etc

GET

PUT - to create or update data create post

update existing post

DELETE - to trash

Authentication

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 9: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

This plugin provides an easy to use REST API available via HTTP

Grab your sitersquos data in simple JSON format including users posts taxonomies and more

Retrieving or updating data is as simple as sending a HTTP request

Want to get your sitersquos posts

Simply send a GET request to

Update user with ID 4

Send a POST request to

wp-jsonwpv2users4

Get all posts with the search term ldquoawesomerdquo

GET

wp-jsonwpv2postssearch=awesome

Itrsquos that easy

The API exposes a simple yet easy interface to WP Query the posts API post meta API users API revisions API and many more

Chances are if you can do it with WordPress WP API will let you do it

Whatrsquos with the V2

A little historyRyan McCue started development on an API and then proposed a WordPress JSON

REST API Project for GSOC in April 2013 (when WordPress was on version 35)

Version 20 of the plugin rebuilt the first with lessons learned The infrastructure

merged into WordPress core in version 44 (December 2015)

A little historyAlthough it was proposed for 45 the

merge was delayed in order to build it out

with more endpoints The REST API is

slated for inclusion in 47 after

considerable discussion and planning

Authentication and further integration

with core will be a focus of 48

Until 47 when this is officially merged into

core (December-ish 2016) wersquoll need to

install the REST API feature Plugin

It about to be realDid you catch that

The REST API merging into

WordPress core

In 47

Thatrsquos a big deal

WPRESTAPIPlugin(for now)

Resources

httpsgithubcomWP-APIWP-API

Resources

httpv2wp-apiorg

Slack Channel

Get Started Today Post 471 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

1 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

InstallThePlugin

Need to do this

until the API

endpoints are

merged into core

NutshellSo in a nutshell rather than getting your content or data via a

webpage as part of a website with php html css and javascript

you can use whatever you want and retrieve your data via the

API Yoursquoll get json data that is compact and fast to transfer and

then you can do endless things with it Create an app load it into

another website analyze it as datahellip itrsquos a great step for

WordPress and a great step to continuing democratizing the web

ToolsPostman -

HTTP or

API client

Also REST Easy for Firefox or httpie for the command line

Back to WordPressThe pluginAPI exposes your data in JSON format in the following content types

Posts

Pages

Media

Custom Post Types

Post Meta

Revisions

Comments

Terms

Users

Routes EndpointsEndpoints are functions available through the API and are simply urls This can be

things like retrieving the API index updating a post or deleting a comment Endpoints

perform a specific function taking some number of parameters and return data to the

client

A route is the ldquonamerdquo you use to access endpoints used in the URL A route can have

multiple endpoints associated with it and which is used depends on the HTTP verb

Routes Endpoints ExampleWith the URL

The ldquorouterdquo is (the route doesnrsquot include wp-json because wp-json

is the base path for the API itself)

This route has 3 endpoints

triggers a get_item method returning the post data to the client

triggers an update_item method taking the data to update and returning the

updated post data

triggers a delete_item method returning the now-deleted post data to the

client

get list of latest posts

retrieve a single post

GET - to read data

Standard arguments as yoursquod expect and more

etc

GET

PUT - to create or update data create post

update existing post

DELETE - to trash

Authentication

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 10: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

Want to get your sitersquos posts

Simply send a GET request to

Update user with ID 4

Send a POST request to

wp-jsonwpv2users4

Get all posts with the search term ldquoawesomerdquo

GET

wp-jsonwpv2postssearch=awesome

Itrsquos that easy

The API exposes a simple yet easy interface to WP Query the posts API post meta API users API revisions API and many more

Chances are if you can do it with WordPress WP API will let you do it

Whatrsquos with the V2

A little historyRyan McCue started development on an API and then proposed a WordPress JSON

REST API Project for GSOC in April 2013 (when WordPress was on version 35)

Version 20 of the plugin rebuilt the first with lessons learned The infrastructure

merged into WordPress core in version 44 (December 2015)

A little historyAlthough it was proposed for 45 the

merge was delayed in order to build it out

with more endpoints The REST API is

slated for inclusion in 47 after

considerable discussion and planning

Authentication and further integration

with core will be a focus of 48

Until 47 when this is officially merged into

core (December-ish 2016) wersquoll need to

install the REST API feature Plugin

It about to be realDid you catch that

The REST API merging into

WordPress core

In 47

Thatrsquos a big deal

WPRESTAPIPlugin(for now)

Resources

httpsgithubcomWP-APIWP-API

Resources

httpv2wp-apiorg

Slack Channel

Get Started Today Post 471 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

1 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

InstallThePlugin

Need to do this

until the API

endpoints are

merged into core

NutshellSo in a nutshell rather than getting your content or data via a

webpage as part of a website with php html css and javascript

you can use whatever you want and retrieve your data via the

API Yoursquoll get json data that is compact and fast to transfer and

then you can do endless things with it Create an app load it into

another website analyze it as datahellip itrsquos a great step for

WordPress and a great step to continuing democratizing the web

ToolsPostman -

HTTP or

API client

Also REST Easy for Firefox or httpie for the command line

Back to WordPressThe pluginAPI exposes your data in JSON format in the following content types

Posts

Pages

Media

Custom Post Types

Post Meta

Revisions

Comments

Terms

Users

Routes EndpointsEndpoints are functions available through the API and are simply urls This can be

things like retrieving the API index updating a post or deleting a comment Endpoints

perform a specific function taking some number of parameters and return data to the

client

A route is the ldquonamerdquo you use to access endpoints used in the URL A route can have

multiple endpoints associated with it and which is used depends on the HTTP verb

Routes Endpoints ExampleWith the URL

The ldquorouterdquo is (the route doesnrsquot include wp-json because wp-json

is the base path for the API itself)

This route has 3 endpoints

triggers a get_item method returning the post data to the client

triggers an update_item method taking the data to update and returning the

updated post data

triggers a delete_item method returning the now-deleted post data to the

client

get list of latest posts

retrieve a single post

GET - to read data

Standard arguments as yoursquod expect and more

etc

GET

PUT - to create or update data create post

update existing post

DELETE - to trash

Authentication

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 11: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

Update user with ID 4

Send a POST request to

wp-jsonwpv2users4

Get all posts with the search term ldquoawesomerdquo

GET

wp-jsonwpv2postssearch=awesome

Itrsquos that easy

The API exposes a simple yet easy interface to WP Query the posts API post meta API users API revisions API and many more

Chances are if you can do it with WordPress WP API will let you do it

Whatrsquos with the V2

A little historyRyan McCue started development on an API and then proposed a WordPress JSON

REST API Project for GSOC in April 2013 (when WordPress was on version 35)

Version 20 of the plugin rebuilt the first with lessons learned The infrastructure

merged into WordPress core in version 44 (December 2015)

A little historyAlthough it was proposed for 45 the

merge was delayed in order to build it out

with more endpoints The REST API is

slated for inclusion in 47 after

considerable discussion and planning

Authentication and further integration

with core will be a focus of 48

Until 47 when this is officially merged into

core (December-ish 2016) wersquoll need to

install the REST API feature Plugin

It about to be realDid you catch that

The REST API merging into

WordPress core

In 47

Thatrsquos a big deal

WPRESTAPIPlugin(for now)

Resources

httpsgithubcomWP-APIWP-API

Resources

httpv2wp-apiorg

Slack Channel

Get Started Today Post 471 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

1 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

InstallThePlugin

Need to do this

until the API

endpoints are

merged into core

NutshellSo in a nutshell rather than getting your content or data via a

webpage as part of a website with php html css and javascript

you can use whatever you want and retrieve your data via the

API Yoursquoll get json data that is compact and fast to transfer and

then you can do endless things with it Create an app load it into

another website analyze it as datahellip itrsquos a great step for

WordPress and a great step to continuing democratizing the web

ToolsPostman -

HTTP or

API client

Also REST Easy for Firefox or httpie for the command line

Back to WordPressThe pluginAPI exposes your data in JSON format in the following content types

Posts

Pages

Media

Custom Post Types

Post Meta

Revisions

Comments

Terms

Users

Routes EndpointsEndpoints are functions available through the API and are simply urls This can be

things like retrieving the API index updating a post or deleting a comment Endpoints

perform a specific function taking some number of parameters and return data to the

client

A route is the ldquonamerdquo you use to access endpoints used in the URL A route can have

multiple endpoints associated with it and which is used depends on the HTTP verb

Routes Endpoints ExampleWith the URL

The ldquorouterdquo is (the route doesnrsquot include wp-json because wp-json

is the base path for the API itself)

This route has 3 endpoints

triggers a get_item method returning the post data to the client

triggers an update_item method taking the data to update and returning the

updated post data

triggers a delete_item method returning the now-deleted post data to the

client

get list of latest posts

retrieve a single post

GET - to read data

Standard arguments as yoursquod expect and more

etc

GET

PUT - to create or update data create post

update existing post

DELETE - to trash

Authentication

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 12: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

Get all posts with the search term ldquoawesomerdquo

GET

wp-jsonwpv2postssearch=awesome

Itrsquos that easy

The API exposes a simple yet easy interface to WP Query the posts API post meta API users API revisions API and many more

Chances are if you can do it with WordPress WP API will let you do it

Whatrsquos with the V2

A little historyRyan McCue started development on an API and then proposed a WordPress JSON

REST API Project for GSOC in April 2013 (when WordPress was on version 35)

Version 20 of the plugin rebuilt the first with lessons learned The infrastructure

merged into WordPress core in version 44 (December 2015)

A little historyAlthough it was proposed for 45 the

merge was delayed in order to build it out

with more endpoints The REST API is

slated for inclusion in 47 after

considerable discussion and planning

Authentication and further integration

with core will be a focus of 48

Until 47 when this is officially merged into

core (December-ish 2016) wersquoll need to

install the REST API feature Plugin

It about to be realDid you catch that

The REST API merging into

WordPress core

In 47

Thatrsquos a big deal

WPRESTAPIPlugin(for now)

Resources

httpsgithubcomWP-APIWP-API

Resources

httpv2wp-apiorg

Slack Channel

Get Started Today Post 471 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

1 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

InstallThePlugin

Need to do this

until the API

endpoints are

merged into core

NutshellSo in a nutshell rather than getting your content or data via a

webpage as part of a website with php html css and javascript

you can use whatever you want and retrieve your data via the

API Yoursquoll get json data that is compact and fast to transfer and

then you can do endless things with it Create an app load it into

another website analyze it as datahellip itrsquos a great step for

WordPress and a great step to continuing democratizing the web

ToolsPostman -

HTTP or

API client

Also REST Easy for Firefox or httpie for the command line

Back to WordPressThe pluginAPI exposes your data in JSON format in the following content types

Posts

Pages

Media

Custom Post Types

Post Meta

Revisions

Comments

Terms

Users

Routes EndpointsEndpoints are functions available through the API and are simply urls This can be

things like retrieving the API index updating a post or deleting a comment Endpoints

perform a specific function taking some number of parameters and return data to the

client

A route is the ldquonamerdquo you use to access endpoints used in the URL A route can have

multiple endpoints associated with it and which is used depends on the HTTP verb

Routes Endpoints ExampleWith the URL

The ldquorouterdquo is (the route doesnrsquot include wp-json because wp-json

is the base path for the API itself)

This route has 3 endpoints

triggers a get_item method returning the post data to the client

triggers an update_item method taking the data to update and returning the

updated post data

triggers a delete_item method returning the now-deleted post data to the

client

get list of latest posts

retrieve a single post

GET - to read data

Standard arguments as yoursquod expect and more

etc

GET

PUT - to create or update data create post

update existing post

DELETE - to trash

Authentication

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 13: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

The API exposes a simple yet easy interface to WP Query the posts API post meta API users API revisions API and many more

Chances are if you can do it with WordPress WP API will let you do it

Whatrsquos with the V2

A little historyRyan McCue started development on an API and then proposed a WordPress JSON

REST API Project for GSOC in April 2013 (when WordPress was on version 35)

Version 20 of the plugin rebuilt the first with lessons learned The infrastructure

merged into WordPress core in version 44 (December 2015)

A little historyAlthough it was proposed for 45 the

merge was delayed in order to build it out

with more endpoints The REST API is

slated for inclusion in 47 after

considerable discussion and planning

Authentication and further integration

with core will be a focus of 48

Until 47 when this is officially merged into

core (December-ish 2016) wersquoll need to

install the REST API feature Plugin

It about to be realDid you catch that

The REST API merging into

WordPress core

In 47

Thatrsquos a big deal

WPRESTAPIPlugin(for now)

Resources

httpsgithubcomWP-APIWP-API

Resources

httpv2wp-apiorg

Slack Channel

Get Started Today Post 471 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

1 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

InstallThePlugin

Need to do this

until the API

endpoints are

merged into core

NutshellSo in a nutshell rather than getting your content or data via a

webpage as part of a website with php html css and javascript

you can use whatever you want and retrieve your data via the

API Yoursquoll get json data that is compact and fast to transfer and

then you can do endless things with it Create an app load it into

another website analyze it as datahellip itrsquos a great step for

WordPress and a great step to continuing democratizing the web

ToolsPostman -

HTTP or

API client

Also REST Easy for Firefox or httpie for the command line

Back to WordPressThe pluginAPI exposes your data in JSON format in the following content types

Posts

Pages

Media

Custom Post Types

Post Meta

Revisions

Comments

Terms

Users

Routes EndpointsEndpoints are functions available through the API and are simply urls This can be

things like retrieving the API index updating a post or deleting a comment Endpoints

perform a specific function taking some number of parameters and return data to the

client

A route is the ldquonamerdquo you use to access endpoints used in the URL A route can have

multiple endpoints associated with it and which is used depends on the HTTP verb

Routes Endpoints ExampleWith the URL

The ldquorouterdquo is (the route doesnrsquot include wp-json because wp-json

is the base path for the API itself)

This route has 3 endpoints

triggers a get_item method returning the post data to the client

triggers an update_item method taking the data to update and returning the

updated post data

triggers a delete_item method returning the now-deleted post data to the

client

get list of latest posts

retrieve a single post

GET - to read data

Standard arguments as yoursquod expect and more

etc

GET

PUT - to create or update data create post

update existing post

DELETE - to trash

Authentication

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 14: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

Whatrsquos with the V2

A little historyRyan McCue started development on an API and then proposed a WordPress JSON

REST API Project for GSOC in April 2013 (when WordPress was on version 35)

Version 20 of the plugin rebuilt the first with lessons learned The infrastructure

merged into WordPress core in version 44 (December 2015)

A little historyAlthough it was proposed for 45 the

merge was delayed in order to build it out

with more endpoints The REST API is

slated for inclusion in 47 after

considerable discussion and planning

Authentication and further integration

with core will be a focus of 48

Until 47 when this is officially merged into

core (December-ish 2016) wersquoll need to

install the REST API feature Plugin

It about to be realDid you catch that

The REST API merging into

WordPress core

In 47

Thatrsquos a big deal

WPRESTAPIPlugin(for now)

Resources

httpsgithubcomWP-APIWP-API

Resources

httpv2wp-apiorg

Slack Channel

Get Started Today Post 471 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

1 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

InstallThePlugin

Need to do this

until the API

endpoints are

merged into core

NutshellSo in a nutshell rather than getting your content or data via a

webpage as part of a website with php html css and javascript

you can use whatever you want and retrieve your data via the

API Yoursquoll get json data that is compact and fast to transfer and

then you can do endless things with it Create an app load it into

another website analyze it as datahellip itrsquos a great step for

WordPress and a great step to continuing democratizing the web

ToolsPostman -

HTTP or

API client

Also REST Easy for Firefox or httpie for the command line

Back to WordPressThe pluginAPI exposes your data in JSON format in the following content types

Posts

Pages

Media

Custom Post Types

Post Meta

Revisions

Comments

Terms

Users

Routes EndpointsEndpoints are functions available through the API and are simply urls This can be

things like retrieving the API index updating a post or deleting a comment Endpoints

perform a specific function taking some number of parameters and return data to the

client

A route is the ldquonamerdquo you use to access endpoints used in the URL A route can have

multiple endpoints associated with it and which is used depends on the HTTP verb

Routes Endpoints ExampleWith the URL

The ldquorouterdquo is (the route doesnrsquot include wp-json because wp-json

is the base path for the API itself)

This route has 3 endpoints

triggers a get_item method returning the post data to the client

triggers an update_item method taking the data to update and returning the

updated post data

triggers a delete_item method returning the now-deleted post data to the

client

get list of latest posts

retrieve a single post

GET - to read data

Standard arguments as yoursquod expect and more

etc

GET

PUT - to create or update data create post

update existing post

DELETE - to trash

Authentication

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 15: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

A little historyRyan McCue started development on an API and then proposed a WordPress JSON

REST API Project for GSOC in April 2013 (when WordPress was on version 35)

Version 20 of the plugin rebuilt the first with lessons learned The infrastructure

merged into WordPress core in version 44 (December 2015)

A little historyAlthough it was proposed for 45 the

merge was delayed in order to build it out

with more endpoints The REST API is

slated for inclusion in 47 after

considerable discussion and planning

Authentication and further integration

with core will be a focus of 48

Until 47 when this is officially merged into

core (December-ish 2016) wersquoll need to

install the REST API feature Plugin

It about to be realDid you catch that

The REST API merging into

WordPress core

In 47

Thatrsquos a big deal

WPRESTAPIPlugin(for now)

Resources

httpsgithubcomWP-APIWP-API

Resources

httpv2wp-apiorg

Slack Channel

Get Started Today Post 471 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

1 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

InstallThePlugin

Need to do this

until the API

endpoints are

merged into core

NutshellSo in a nutshell rather than getting your content or data via a

webpage as part of a website with php html css and javascript

you can use whatever you want and retrieve your data via the

API Yoursquoll get json data that is compact and fast to transfer and

then you can do endless things with it Create an app load it into

another website analyze it as datahellip itrsquos a great step for

WordPress and a great step to continuing democratizing the web

ToolsPostman -

HTTP or

API client

Also REST Easy for Firefox or httpie for the command line

Back to WordPressThe pluginAPI exposes your data in JSON format in the following content types

Posts

Pages

Media

Custom Post Types

Post Meta

Revisions

Comments

Terms

Users

Routes EndpointsEndpoints are functions available through the API and are simply urls This can be

things like retrieving the API index updating a post or deleting a comment Endpoints

perform a specific function taking some number of parameters and return data to the

client

A route is the ldquonamerdquo you use to access endpoints used in the URL A route can have

multiple endpoints associated with it and which is used depends on the HTTP verb

Routes Endpoints ExampleWith the URL

The ldquorouterdquo is (the route doesnrsquot include wp-json because wp-json

is the base path for the API itself)

This route has 3 endpoints

triggers a get_item method returning the post data to the client

triggers an update_item method taking the data to update and returning the

updated post data

triggers a delete_item method returning the now-deleted post data to the

client

get list of latest posts

retrieve a single post

GET - to read data

Standard arguments as yoursquod expect and more

etc

GET

PUT - to create or update data create post

update existing post

DELETE - to trash

Authentication

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 16: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

A little historyAlthough it was proposed for 45 the

merge was delayed in order to build it out

with more endpoints The REST API is

slated for inclusion in 47 after

considerable discussion and planning

Authentication and further integration

with core will be a focus of 48

Until 47 when this is officially merged into

core (December-ish 2016) wersquoll need to

install the REST API feature Plugin

It about to be realDid you catch that

The REST API merging into

WordPress core

In 47

Thatrsquos a big deal

WPRESTAPIPlugin(for now)

Resources

httpsgithubcomWP-APIWP-API

Resources

httpv2wp-apiorg

Slack Channel

Get Started Today Post 471 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

1 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

InstallThePlugin

Need to do this

until the API

endpoints are

merged into core

NutshellSo in a nutshell rather than getting your content or data via a

webpage as part of a website with php html css and javascript

you can use whatever you want and retrieve your data via the

API Yoursquoll get json data that is compact and fast to transfer and

then you can do endless things with it Create an app load it into

another website analyze it as datahellip itrsquos a great step for

WordPress and a great step to continuing democratizing the web

ToolsPostman -

HTTP or

API client

Also REST Easy for Firefox or httpie for the command line

Back to WordPressThe pluginAPI exposes your data in JSON format in the following content types

Posts

Pages

Media

Custom Post Types

Post Meta

Revisions

Comments

Terms

Users

Routes EndpointsEndpoints are functions available through the API and are simply urls This can be

things like retrieving the API index updating a post or deleting a comment Endpoints

perform a specific function taking some number of parameters and return data to the

client

A route is the ldquonamerdquo you use to access endpoints used in the URL A route can have

multiple endpoints associated with it and which is used depends on the HTTP verb

Routes Endpoints ExampleWith the URL

The ldquorouterdquo is (the route doesnrsquot include wp-json because wp-json

is the base path for the API itself)

This route has 3 endpoints

triggers a get_item method returning the post data to the client

triggers an update_item method taking the data to update and returning the

updated post data

triggers a delete_item method returning the now-deleted post data to the

client

get list of latest posts

retrieve a single post

GET - to read data

Standard arguments as yoursquod expect and more

etc

GET

PUT - to create or update data create post

update existing post

DELETE - to trash

Authentication

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 17: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

It about to be realDid you catch that

The REST API merging into

WordPress core

In 47

Thatrsquos a big deal

WPRESTAPIPlugin(for now)

Resources

httpsgithubcomWP-APIWP-API

Resources

httpv2wp-apiorg

Slack Channel

Get Started Today Post 471 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

1 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

InstallThePlugin

Need to do this

until the API

endpoints are

merged into core

NutshellSo in a nutshell rather than getting your content or data via a

webpage as part of a website with php html css and javascript

you can use whatever you want and retrieve your data via the

API Yoursquoll get json data that is compact and fast to transfer and

then you can do endless things with it Create an app load it into

another website analyze it as datahellip itrsquos a great step for

WordPress and a great step to continuing democratizing the web

ToolsPostman -

HTTP or

API client

Also REST Easy for Firefox or httpie for the command line

Back to WordPressThe pluginAPI exposes your data in JSON format in the following content types

Posts

Pages

Media

Custom Post Types

Post Meta

Revisions

Comments

Terms

Users

Routes EndpointsEndpoints are functions available through the API and are simply urls This can be

things like retrieving the API index updating a post or deleting a comment Endpoints

perform a specific function taking some number of parameters and return data to the

client

A route is the ldquonamerdquo you use to access endpoints used in the URL A route can have

multiple endpoints associated with it and which is used depends on the HTTP verb

Routes Endpoints ExampleWith the URL

The ldquorouterdquo is (the route doesnrsquot include wp-json because wp-json

is the base path for the API itself)

This route has 3 endpoints

triggers a get_item method returning the post data to the client

triggers an update_item method taking the data to update and returning the

updated post data

triggers a delete_item method returning the now-deleted post data to the

client

get list of latest posts

retrieve a single post

GET - to read data

Standard arguments as yoursquod expect and more

etc

GET

PUT - to create or update data create post

update existing post

DELETE - to trash

Authentication

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 18: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

WPRESTAPIPlugin(for now)

Resources

httpsgithubcomWP-APIWP-API

Resources

httpv2wp-apiorg

Slack Channel

Get Started Today Post 471 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

1 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

InstallThePlugin

Need to do this

until the API

endpoints are

merged into core

NutshellSo in a nutshell rather than getting your content or data via a

webpage as part of a website with php html css and javascript

you can use whatever you want and retrieve your data via the

API Yoursquoll get json data that is compact and fast to transfer and

then you can do endless things with it Create an app load it into

another website analyze it as datahellip itrsquos a great step for

WordPress and a great step to continuing democratizing the web

ToolsPostman -

HTTP or

API client

Also REST Easy for Firefox or httpie for the command line

Back to WordPressThe pluginAPI exposes your data in JSON format in the following content types

Posts

Pages

Media

Custom Post Types

Post Meta

Revisions

Comments

Terms

Users

Routes EndpointsEndpoints are functions available through the API and are simply urls This can be

things like retrieving the API index updating a post or deleting a comment Endpoints

perform a specific function taking some number of parameters and return data to the

client

A route is the ldquonamerdquo you use to access endpoints used in the URL A route can have

multiple endpoints associated with it and which is used depends on the HTTP verb

Routes Endpoints ExampleWith the URL

The ldquorouterdquo is (the route doesnrsquot include wp-json because wp-json

is the base path for the API itself)

This route has 3 endpoints

triggers a get_item method returning the post data to the client

triggers an update_item method taking the data to update and returning the

updated post data

triggers a delete_item method returning the now-deleted post data to the

client

get list of latest posts

retrieve a single post

GET - to read data

Standard arguments as yoursquod expect and more

etc

GET

PUT - to create or update data create post

update existing post

DELETE - to trash

Authentication

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 19: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

Resources

httpsgithubcomWP-APIWP-API

Resources

httpv2wp-apiorg

Slack Channel

Get Started Today Post 471 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

1 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

InstallThePlugin

Need to do this

until the API

endpoints are

merged into core

NutshellSo in a nutshell rather than getting your content or data via a

webpage as part of a website with php html css and javascript

you can use whatever you want and retrieve your data via the

API Yoursquoll get json data that is compact and fast to transfer and

then you can do endless things with it Create an app load it into

another website analyze it as datahellip itrsquos a great step for

WordPress and a great step to continuing democratizing the web

ToolsPostman -

HTTP or

API client

Also REST Easy for Firefox or httpie for the command line

Back to WordPressThe pluginAPI exposes your data in JSON format in the following content types

Posts

Pages

Media

Custom Post Types

Post Meta

Revisions

Comments

Terms

Users

Routes EndpointsEndpoints are functions available through the API and are simply urls This can be

things like retrieving the API index updating a post or deleting a comment Endpoints

perform a specific function taking some number of parameters and return data to the

client

A route is the ldquonamerdquo you use to access endpoints used in the URL A route can have

multiple endpoints associated with it and which is used depends on the HTTP verb

Routes Endpoints ExampleWith the URL

The ldquorouterdquo is (the route doesnrsquot include wp-json because wp-json

is the base path for the API itself)

This route has 3 endpoints

triggers a get_item method returning the post data to the client

triggers an update_item method taking the data to update and returning the

updated post data

triggers a delete_item method returning the now-deleted post data to the

client

get list of latest posts

retrieve a single post

GET - to read data

Standard arguments as yoursquod expect and more

etc

GET

PUT - to create or update data create post

update existing post

DELETE - to trash

Authentication

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 20: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

Resources

httpv2wp-apiorg

Slack Channel

Get Started Today Post 471 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

1 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

InstallThePlugin

Need to do this

until the API

endpoints are

merged into core

NutshellSo in a nutshell rather than getting your content or data via a

webpage as part of a website with php html css and javascript

you can use whatever you want and retrieve your data via the

API Yoursquoll get json data that is compact and fast to transfer and

then you can do endless things with it Create an app load it into

another website analyze it as datahellip itrsquos a great step for

WordPress and a great step to continuing democratizing the web

ToolsPostman -

HTTP or

API client

Also REST Easy for Firefox or httpie for the command line

Back to WordPressThe pluginAPI exposes your data in JSON format in the following content types

Posts

Pages

Media

Custom Post Types

Post Meta

Revisions

Comments

Terms

Users

Routes EndpointsEndpoints are functions available through the API and are simply urls This can be

things like retrieving the API index updating a post or deleting a comment Endpoints

perform a specific function taking some number of parameters and return data to the

client

A route is the ldquonamerdquo you use to access endpoints used in the URL A route can have

multiple endpoints associated with it and which is used depends on the HTTP verb

Routes Endpoints ExampleWith the URL

The ldquorouterdquo is (the route doesnrsquot include wp-json because wp-json

is the base path for the API itself)

This route has 3 endpoints

triggers a get_item method returning the post data to the client

triggers an update_item method taking the data to update and returning the

updated post data

triggers a delete_item method returning the now-deleted post data to the

client

get list of latest posts

retrieve a single post

GET - to read data

Standard arguments as yoursquod expect and more

etc

GET

PUT - to create or update data create post

update existing post

DELETE - to trash

Authentication

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 21: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

Slack Channel

Get Started Today Post 471 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

1 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

InstallThePlugin

Need to do this

until the API

endpoints are

merged into core

NutshellSo in a nutshell rather than getting your content or data via a

webpage as part of a website with php html css and javascript

you can use whatever you want and retrieve your data via the

API Yoursquoll get json data that is compact and fast to transfer and

then you can do endless things with it Create an app load it into

another website analyze it as datahellip itrsquos a great step for

WordPress and a great step to continuing democratizing the web

ToolsPostman -

HTTP or

API client

Also REST Easy for Firefox or httpie for the command line

Back to WordPressThe pluginAPI exposes your data in JSON format in the following content types

Posts

Pages

Media

Custom Post Types

Post Meta

Revisions

Comments

Terms

Users

Routes EndpointsEndpoints are functions available through the API and are simply urls This can be

things like retrieving the API index updating a post or deleting a comment Endpoints

perform a specific function taking some number of parameters and return data to the

client

A route is the ldquonamerdquo you use to access endpoints used in the URL A route can have

multiple endpoints associated with it and which is used depends on the HTTP verb

Routes Endpoints ExampleWith the URL

The ldquorouterdquo is (the route doesnrsquot include wp-json because wp-json

is the base path for the API itself)

This route has 3 endpoints

triggers a get_item method returning the post data to the client

triggers an update_item method taking the data to update and returning the

updated post data

triggers a delete_item method returning the now-deleted post data to the

client

get list of latest posts

retrieve a single post

GET - to read data

Standard arguments as yoursquod expect and more

etc

GET

PUT - to create or update data create post

update existing post

DELETE - to trash

Authentication

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 22: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

Get Started Today Post 471 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

1 Install the plugin

2 Play

a yoursitecomwp-jsonwpv2

InstallThePlugin

Need to do this

until the API

endpoints are

merged into core

NutshellSo in a nutshell rather than getting your content or data via a

webpage as part of a website with php html css and javascript

you can use whatever you want and retrieve your data via the

API Yoursquoll get json data that is compact and fast to transfer and

then you can do endless things with it Create an app load it into

another website analyze it as datahellip itrsquos a great step for

WordPress and a great step to continuing democratizing the web

ToolsPostman -

HTTP or

API client

Also REST Easy for Firefox or httpie for the command line

Back to WordPressThe pluginAPI exposes your data in JSON format in the following content types

Posts

Pages

Media

Custom Post Types

Post Meta

Revisions

Comments

Terms

Users

Routes EndpointsEndpoints are functions available through the API and are simply urls This can be

things like retrieving the API index updating a post or deleting a comment Endpoints

perform a specific function taking some number of parameters and return data to the

client

A route is the ldquonamerdquo you use to access endpoints used in the URL A route can have

multiple endpoints associated with it and which is used depends on the HTTP verb

Routes Endpoints ExampleWith the URL

The ldquorouterdquo is (the route doesnrsquot include wp-json because wp-json

is the base path for the API itself)

This route has 3 endpoints

triggers a get_item method returning the post data to the client

triggers an update_item method taking the data to update and returning the

updated post data

triggers a delete_item method returning the now-deleted post data to the

client

get list of latest posts

retrieve a single post

GET - to read data

Standard arguments as yoursquod expect and more

etc

GET

PUT - to create or update data create post

update existing post

DELETE - to trash

Authentication

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 23: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

InstallThePlugin

Need to do this

until the API

endpoints are

merged into core

NutshellSo in a nutshell rather than getting your content or data via a

webpage as part of a website with php html css and javascript

you can use whatever you want and retrieve your data via the

API Yoursquoll get json data that is compact and fast to transfer and

then you can do endless things with it Create an app load it into

another website analyze it as datahellip itrsquos a great step for

WordPress and a great step to continuing democratizing the web

ToolsPostman -

HTTP or

API client

Also REST Easy for Firefox or httpie for the command line

Back to WordPressThe pluginAPI exposes your data in JSON format in the following content types

Posts

Pages

Media

Custom Post Types

Post Meta

Revisions

Comments

Terms

Users

Routes EndpointsEndpoints are functions available through the API and are simply urls This can be

things like retrieving the API index updating a post or deleting a comment Endpoints

perform a specific function taking some number of parameters and return data to the

client

A route is the ldquonamerdquo you use to access endpoints used in the URL A route can have

multiple endpoints associated with it and which is used depends on the HTTP verb

Routes Endpoints ExampleWith the URL

The ldquorouterdquo is (the route doesnrsquot include wp-json because wp-json

is the base path for the API itself)

This route has 3 endpoints

triggers a get_item method returning the post data to the client

triggers an update_item method taking the data to update and returning the

updated post data

triggers a delete_item method returning the now-deleted post data to the

client

get list of latest posts

retrieve a single post

GET - to read data

Standard arguments as yoursquod expect and more

etc

GET

PUT - to create or update data create post

update existing post

DELETE - to trash

Authentication

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 24: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

NutshellSo in a nutshell rather than getting your content or data via a

webpage as part of a website with php html css and javascript

you can use whatever you want and retrieve your data via the

API Yoursquoll get json data that is compact and fast to transfer and

then you can do endless things with it Create an app load it into

another website analyze it as datahellip itrsquos a great step for

WordPress and a great step to continuing democratizing the web

ToolsPostman -

HTTP or

API client

Also REST Easy for Firefox or httpie for the command line

Back to WordPressThe pluginAPI exposes your data in JSON format in the following content types

Posts

Pages

Media

Custom Post Types

Post Meta

Revisions

Comments

Terms

Users

Routes EndpointsEndpoints are functions available through the API and are simply urls This can be

things like retrieving the API index updating a post or deleting a comment Endpoints

perform a specific function taking some number of parameters and return data to the

client

A route is the ldquonamerdquo you use to access endpoints used in the URL A route can have

multiple endpoints associated with it and which is used depends on the HTTP verb

Routes Endpoints ExampleWith the URL

The ldquorouterdquo is (the route doesnrsquot include wp-json because wp-json

is the base path for the API itself)

This route has 3 endpoints

triggers a get_item method returning the post data to the client

triggers an update_item method taking the data to update and returning the

updated post data

triggers a delete_item method returning the now-deleted post data to the

client

get list of latest posts

retrieve a single post

GET - to read data

Standard arguments as yoursquod expect and more

etc

GET

PUT - to create or update data create post

update existing post

DELETE - to trash

Authentication

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 25: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

ToolsPostman -

HTTP or

API client

Also REST Easy for Firefox or httpie for the command line

Back to WordPressThe pluginAPI exposes your data in JSON format in the following content types

Posts

Pages

Media

Custom Post Types

Post Meta

Revisions

Comments

Terms

Users

Routes EndpointsEndpoints are functions available through the API and are simply urls This can be

things like retrieving the API index updating a post or deleting a comment Endpoints

perform a specific function taking some number of parameters and return data to the

client

A route is the ldquonamerdquo you use to access endpoints used in the URL A route can have

multiple endpoints associated with it and which is used depends on the HTTP verb

Routes Endpoints ExampleWith the URL

The ldquorouterdquo is (the route doesnrsquot include wp-json because wp-json

is the base path for the API itself)

This route has 3 endpoints

triggers a get_item method returning the post data to the client

triggers an update_item method taking the data to update and returning the

updated post data

triggers a delete_item method returning the now-deleted post data to the

client

get list of latest posts

retrieve a single post

GET - to read data

Standard arguments as yoursquod expect and more

etc

GET

PUT - to create or update data create post

update existing post

DELETE - to trash

Authentication

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 26: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

Back to WordPressThe pluginAPI exposes your data in JSON format in the following content types

Posts

Pages

Media

Custom Post Types

Post Meta

Revisions

Comments

Terms

Users

Routes EndpointsEndpoints are functions available through the API and are simply urls This can be

things like retrieving the API index updating a post or deleting a comment Endpoints

perform a specific function taking some number of parameters and return data to the

client

A route is the ldquonamerdquo you use to access endpoints used in the URL A route can have

multiple endpoints associated with it and which is used depends on the HTTP verb

Routes Endpoints ExampleWith the URL

The ldquorouterdquo is (the route doesnrsquot include wp-json because wp-json

is the base path for the API itself)

This route has 3 endpoints

triggers a get_item method returning the post data to the client

triggers an update_item method taking the data to update and returning the

updated post data

triggers a delete_item method returning the now-deleted post data to the

client

get list of latest posts

retrieve a single post

GET - to read data

Standard arguments as yoursquod expect and more

etc

GET

PUT - to create or update data create post

update existing post

DELETE - to trash

Authentication

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 27: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

Routes EndpointsEndpoints are functions available through the API and are simply urls This can be

things like retrieving the API index updating a post or deleting a comment Endpoints

perform a specific function taking some number of parameters and return data to the

client

A route is the ldquonamerdquo you use to access endpoints used in the URL A route can have

multiple endpoints associated with it and which is used depends on the HTTP verb

Routes Endpoints ExampleWith the URL

The ldquorouterdquo is (the route doesnrsquot include wp-json because wp-json

is the base path for the API itself)

This route has 3 endpoints

triggers a get_item method returning the post data to the client

triggers an update_item method taking the data to update and returning the

updated post data

triggers a delete_item method returning the now-deleted post data to the

client

get list of latest posts

retrieve a single post

GET - to read data

Standard arguments as yoursquod expect and more

etc

GET

PUT - to create or update data create post

update existing post

DELETE - to trash

Authentication

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 28: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

Routes Endpoints ExampleWith the URL

The ldquorouterdquo is (the route doesnrsquot include wp-json because wp-json

is the base path for the API itself)

This route has 3 endpoints

triggers a get_item method returning the post data to the client

triggers an update_item method taking the data to update and returning the

updated post data

triggers a delete_item method returning the now-deleted post data to the

client

get list of latest posts

retrieve a single post

GET - to read data

Standard arguments as yoursquod expect and more

etc

GET

PUT - to create or update data create post

update existing post

DELETE - to trash

Authentication

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 29: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

get list of latest posts

retrieve a single post

GET - to read data

Standard arguments as yoursquod expect and more

etc

GET

PUT - to create or update data create post

update existing post

DELETE - to trash

Authentication

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 30: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

Standard arguments as yoursquod expect and more

etc

GET

PUT - to create or update data create post

update existing post

DELETE - to trash

Authentication

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 31: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

PUT - to create or update data create post

update existing post

DELETE - to trash

Authentication

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 32: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

DELETE - to trash

Authentication

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 33: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

Authentication

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 34: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

AuthenticationWhen and why would you need this

Internal wp code (plugintheme development) use cookies

External code (using wp api as service) use oauth

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 35: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

AuthenticationIf you are building a theme or a plugin and want to access

the API of the same site where the theme or plugin will be

yoursquoll want to authenticate with a cookie

Use a nonce (WordPress security token) to connect to a

local API if your theme or plugin wants to connect to the

API of the site itrsquos on via ajax

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 36: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

NonceA nonce is a number used once or one-time token generated by a web site to identify

future requests to that site

WordPress nonces arent numbers but are a hash made up of numbers and letters

Nor are they used only once but have a limited lifetime after which they expire

WordPresss security tokens are called nonces despite the above noted differences

from true nonces because they serve much the same purpose

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 37: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

AuthenticationWrite a nonce in a

with

and then pass that nonce

value in your header

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 38: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

The nonce in action

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 39: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

AuthenticationWrite a nonce in a

with

and then pass that

nonce value in your

header

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 40: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

OAuth example here please

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 41: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

Authentication

OAuth authentication is the main authentication handler used for external clients It

requires installing the OAuth plugin on the site which then handles authorizations and

tokens

For examples on how to use OAuth Authentication checkout the Demo PHP API

Client the CLI client or the API console

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 42: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

WP REST APIOAuth 10aPlugin

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 43: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

1 Discovery

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 44: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

2 Input Credentials

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 45: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

3 Authorized and Connected

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 46: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

Extend - Do MoreModifying Responses

Adding Endpoints

Custom Content Types

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 47: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

ACF to APIGet ACF custom

fields to display in

your post JSON

easily with this

plugin

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 48: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

Examples with Under the Hood Code1 Mobile App - Content via WP

2 WordPress Plugin - Sitemapper

3 External site - Content via WP

4 WordPress Plugin - using js client

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 49: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

Mobile App - US PresidentsAn app will test your knowledge and teach you the Presidents of the USA ndash powered

with WordPress via

the REST API

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 50: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

US Presidential Mobile App

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 51: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

Plugin - SitemapperAn in-house plugin at Brown Bag

Marketing to quickly get up and

running with a new WordPress site in

our prototyping and wireframing

multisite

Construct your sitemap and the plugin

will create a new site (in the multisite

network) and via the API create new

pages according to the supplied

sitemap

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 52: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

External Site - Digital DashboardAngular web app built at

Brown Bag Marketing to

display live stats about a

bunch of sites Connects

to sites like pingdom

analytics etc The sites

are stored in WordPress

as a CPT and loaded

dynamically and it has

featured content thatrsquos

pulled from the WP API

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 53: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

Plugin - Revision BrowserBrowse WordPress revisions on the

front-end of your website

The REST API includes a

JavaScriptBackbone client library which

provides an interface for the WP REST

API by providing Backbone Models and

Collections for all endpoints exposed the

API Schema

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 54: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

Examples

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 55: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

Story Corpsme

https10upcomblog2015scaling-storycorps-wordpress-json-api amp

httpspoststatuscomhow-storycorps-uses-wordpress-to-enable-storytelling-everywhere

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 56: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

Calypso

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 57: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

NYTimes

httpwwwslidesharenetScottTaylor1rest-in-action-the-live-coverage-platform-at-the-new-york-times

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 58: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

Nomadbaseio

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 59: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

CustomContactFormsPlugin

httpswptaverncomcustom-contact-forms-plugin-passes-1-million-downloads-on-wordpress-org

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 60: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

Event Espresso4

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 61: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

WPLiveSearch

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 62: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

ACF to REST API

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 63: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

A WordPress REST API White Paper

by Human Made

Additional Reading

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 64: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

The ultimate guide to the WordPress REST API

By Josh Pollock (Torque)

Additional Reading

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 65: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

Questions Comments More (better) Examples Discuss

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 66: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

More Additional Reading httpv2wp-apiorgreferenceposts

httpsdemowp-apiorg

httpsdeliciousbrainscomcreating-mobile-app-wp-api-react-native

httpscss-trickscomwp-rest-api-remote-control-wordpress

httpswpshoutcomguide-wordpress-rest-api-interview-josh-pollock

httpscodetutspluscomtutorialsintroducing-the-wp-rest-api--cms-24533

httpswwwsitepointcomwp-api

httpswebdevstudioscom20160105an-overview-of-the-wordpress-json-api-version-2

httpswwwwpkubecomimplementations-wp-rest-api

Thank You

Slides available at httpscirclecubecomdoes-wordpress

Page 67: WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!

Thank You

Slides available at httpscirclecubecomdoes-wordpress