WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!
-
Upload
evan-mullins -
Category
Technology
-
view
97 -
download
0
Transcript of 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Thank You
Slides available at httpscirclecubecomdoes-wordpress