SlideShare a Scribd company logo
1 of 37
Download to read offline
JSON REST API for WordPress 
@tlovett12 
+ JSON 
REST API 
=
Who Am I? 
• My name is Taylor Lovett! 
• Director of Web Engineering at 10up 
• Open source community member 
• WordPress core contributor 
• WP API team member 
@tlovett12
We are hiring! 
@tlovett12
So what’s this new WP API thing all 
about? Don’t we already have one?
Right now, we have XML-RPC. It works but 
is extremely hard to use and outdated.
Comparison to other WordPress API’s 
! 
https://github.com/WP-API/WP-API/blob/ 
master/docs/comparison.md
Why JSON REST API? 
• In a nutshell, JSON REST API’s have swept the 
web becoming an almost standard. They are 
extremely intuitive and provide an easy way to 
distribute, collect, and modify data. 
Let’s break it down a bit.
JSON 
• JSON is an abbreviation for “JavaScript Object Notation” 
• It’s simply a way to describe data that is lightweight and 
extremely easy to use. Arguably much easier to use than 
XML.
REST 
• REST (Representational State Transfer) is an architectural style 
that dictates how HTTP and URI’s should be used and organized. 
• Verbs and resources: GET /post/1 
• Hypermedia as the Engine of Application State (HATEOAS) - 
Server provides everything you need to know how to use it in a 
response. 
• Actions are autonomous and do not depend on each other. 
• Bottom line: RESTful API’s have become extremely popular 
across the web. They are much easier to use than things like RPC 
or SOAP.
And of course, API 
• An API (Application Programming Interface) is a 
set of entry points that allow you to interact with 
a platform (WordPress in this case).
Ryan McCue and Contributors
How can I start using it now?
First, install the plugin 
http://wordpress.org/plugins/json-rest-api/ 
! 
Core integration coming soon.
What does the API allow me to do? 
/wp-json/ 
Shows all the routes and endpoints available 
/wp-json/posts 
Create, read, update, and delete posts 
/wp-json/users 
Create, read, update, and delete users 
/wp-json/media 
Create, read, update, and delete media items 
/wp-json/taxonomies 
Read taxonomies and terms 
/wp-json/pages/ 
Create, read, update, and delete pages
The API is rich with functionality. 
Explore the documentation! 
http://wp-api.org/docs-development/ 
Let’s look at a few key endpoints.
List Posts 
[{! 
"ID": 11297,! 
"title": "Post 19",! 
"status": "publish",! 
"type": "post",! 
"author": 1,! 
"content": "",! 
"parent": null,! 
"link": "http://example.com/2014/08/post-19/",! 
"format": "standard",! 
"slug": "post-19",! 
"guid": "http://example.com/2014/08/post-19/",! 
"excerpt": null,! 
"menu_order": 0,! 
"comment_status": "closed",! 
"ping_status": "open",! 
"sticky": false,! 
"meta": {},! 
"featured_image": null,! 
"terms": {}! 
}] 
GET /wp-json/posts
List Posts 
Endpoint: /wp-json/posts 
Takes a number of useful parameters: 
• Filter[]: Accepts WP_Query arguments 
• Page: Allows for pagination 
• Context: Determines usage context i.e. “view or edit” 
• … 
https://github.com/WP-API/WP-API/blob/master/docs/routes/routes.md
Retrieve A Post 
{! 
"ID": 11297,! 
"title": "Post 19",! 
"status": "publish",! 
"type": "post",! 
"author": 1,! 
"content": "",! 
"parent": null,! 
"link": "http://example.com/2014/08/post-19/",! 
"format": "standard",! 
"slug": "post-19",! 
"guid": "http://example.com/2014/08/post-19/",! 
"excerpt": null,! 
"menu_order": 0,! 
"comment_status": "closed",! 
"ping_status": "open",! 
"sticky": false,! 
"meta": {},! 
"featured_image": null,! 
"terms": {}! 
} 
GET /wp-json/posts/<id>
Edit A Post 
PUT /wp-json/posts/<id> 
curl -X PUT -H “Content-Type: application/json” -d ‘! 
{! 
"title": “Updated Title",! 
“content_raw": “Updated post content"! 
}! 
‘ -u admin:password http://example.com/wp-json/posts/<id> 
We need to send a PUT request to this endpoint with 
our post data. Of course we must authenticate before 
doing this.
Three ways to authenticate 
• Cookie Authentication (client side) 
• HTTP Basic Authentication 
• OAuth 1
HTTP Basic Authentication 
First install the WP Basic Auth Plugin: 
https://github.com/WP-API/Basic-Auth 
Remember this piece of our cURL request? 
-u admin:password 
That’s HTTP Basic Authentication! Essentially we are authenticating 
by passing an HTTP header like this: 
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== 
Where that crazy looking string is username:password base64 
encoded.
HTTP Basic Authentication 
should only be used for testing!
OAuth 1.0a 
First install the WP OAuth Plugin: 
https://github.com/WP-API/OAuth1 
OAuth is outside of the scope of this talk. However, it 
should be used instead of HTTP Basic Auth when 
building external applications that interact with the 
API. Rather than giving someone an account on your 
site, you can give them temporary access with 
OAuth.
Create A Post 
POST /wp-json/posts/ 
curl -X POST -H “Content-Type: application/json” -d ‘! 
{! 
"title": “Title",! 
“content_raw": “Post content"! 
}! 
‘ -u admin:password http://example.com/wp-json/posts/ 
Notice we are using a POST request this time.
Taxonomies 
GET /wp-json/taxonomies 
[! 
{! 
"name": "Categories",! 
"slug": "category",! 
"labels": {},! 
"types": { /* Registered post types */ },! 
"show_cloud": true,! 
"hierarchical": true,! 
"meta": {}! 
},! 
{! 
"name": "Tags",! 
"slug": "post_tag",! 
"labels": {},! 
"types": { /* Registered post types */ },! 
"show_cloud": true,! 
"hierarchical": false,! 
"meta": {}! 
}! 
}! 
]
Taxonomy 
GET /wp-json/taxonomies/<taxonomy> 
{! 
"name": "Categories",! 
"slug": "category",! 
"labels": {},! 
"types": { /* Registered post types */ },! 
"show_cloud": true,! 
"hierarchical": true,! 
"meta": {}! 
}
Taxonomy Terms 
GET /wp-json/taxonomies/<taxonomy>/terms 
[! 
{! 
"ID": 1,! 
"name": "Books",! 
"slug": "books",! 
"description": "",! 
"parent": null,! 
"count": 1,! 
"link": "http://example.com/category/books/",! 
"meta": {}! 
},! 
{! 
"ID": 2,! 
"name": "Products",! 
"slug": "products",! 
"description": "",! 
"parent": null,! 
"count": 1,! 
"link": "http://example.com/category/products/",! 
"meta": {}! 
}! 
]
Build Your Own Routes and Endpoints 
WP API is very extensible (custom post types!) 
http://wp-api.org/guides/extending.html
What can I do with the JSON 
REST API for WordPress?
JavaScript 
Interact with your (or someone else’s) WordPress install with 
JavaScript. 
Backbone.js Client: 
https://github.com/WP-API/client-js 
! 
! 
Node.js Client: 
https://github.com/kadamwhite/wordpress-rest-api 
!
Backbone.js 
• Backbone.js is a JavaScript framework that lets 
you structure code in terms of models, views, 
and collections. It works great with RESTful 
JSON API’s.
_s_backbone 
• _s or underscores is a popular starter theme by 
Automattic: 
https://github.com/automattic/_s 
• _s_backbone is an _s fork that powers post 
loops using the WP API Backbone client
https://github.com/tlovett1/_s_backbone
What does this mean? 
• It means _s_backbone is a starter theme with 
infinite scroll built-in using the WP API Backbone 
client. 
• Infinite scroll is the concept of loading multiple 
rounds of entities without reloading the page. 
Let’s look at some code!
This is some JavaScript you could add to a theme or 
plugin to display your site’s posts. You will first need 
to have JSON REST API for WordPress installed and 
the “wp-api” JavaScript dependency enqueued. 
functions.php: 
js/scripts.js:
If you learned nothing so far, 
know this: 
You can do amazing things with the JSON REST 
API for WordPress. 
With core integration and ~23% of the web using 
this API in the near future, you will have much 
easier access to data across the web.
Questions? 
@tlovett12! 
taylor.lovett@10up.com! 
taylorlovett.com 
We need to send a PUT request to this endpoint with 
our post data. Of course we must authenticate before 
doing this.

More Related Content

What's hot

Best Practices for WordPress
Best Practices for WordPressBest Practices for WordPress
Best Practices for WordPressTaylor Lovett
 
Scalable web application architecture
Scalable web application architectureScalable web application architecture
Scalable web application architecturepostrational
 
Advanced WordPress Development Environments
Advanced WordPress Development EnvironmentsAdvanced WordPress Development Environments
Advanced WordPress Development EnvironmentsBeau Lebens
 
Building Your First App with MongoDB
Building Your First App with MongoDBBuilding Your First App with MongoDB
Building Your First App with MongoDBMongoDB
 
Put a little Backbone in your WordPress
Put a little Backbone in your WordPressPut a little Backbone in your WordPress
Put a little Backbone in your WordPressadamsilverstein
 
CouchDB for Web Applications - Erlang Factory London 2009
CouchDB for Web Applications - Erlang Factory London 2009CouchDB for Web Applications - Erlang Factory London 2009
CouchDB for Web Applications - Erlang Factory London 2009Jason Davies
 
The never-ending REST API design debate
The never-ending REST API design debateThe never-ending REST API design debate
The never-ending REST API design debateRestlet
 
Introduction to Plugin Programming, WordCamp Miami 2011
Introduction to Plugin Programming, WordCamp Miami 2011Introduction to Plugin Programming, WordCamp Miami 2011
Introduction to Plugin Programming, WordCamp Miami 2011David Carr
 
Differential Sync and JSON Patch @ SpringOne2GX 2014
Differential Sync and JSON Patch @ SpringOne2GX 2014Differential Sync and JSON Patch @ SpringOne2GX 2014
Differential Sync and JSON Patch @ SpringOne2GX 2014Brian Cavalier
 
Hypermedia: The Missing Element to Building Adaptable Web APIs in Rails
Hypermedia: The Missing Element to Building Adaptable Web APIs in RailsHypermedia: The Missing Element to Building Adaptable Web APIs in Rails
Hypermedia: The Missing Element to Building Adaptable Web APIs in RailsToru Kawamura
 
Introducing RaveJS: Spring Boot concepts for JavaScript applications
Introducing RaveJS: Spring Boot concepts for JavaScript applicationsIntroducing RaveJS: Spring Boot concepts for JavaScript applications
Introducing RaveJS: Spring Boot concepts for JavaScript applicationsJohn Hann
 
REST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in CodeigniterREST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in CodeigniterSachin G Kulkarni
 
Transforming WordPress Search and Query Performance with Elasticsearch
Transforming WordPress Search and Query Performance with Elasticsearch Transforming WordPress Search and Query Performance with Elasticsearch
Transforming WordPress Search and Query Performance with Elasticsearch Taylor Lovett
 
REST Web API with MongoDB
REST Web API with MongoDBREST Web API with MongoDB
REST Web API with MongoDBMongoDB
 
Introduction to CouchDB
Introduction to CouchDBIntroduction to CouchDB
Introduction to CouchDBOpusVL
 
Understanding and testing restful web services
Understanding and testing restful web servicesUnderstanding and testing restful web services
Understanding and testing restful web servicesmwinteringham
 
Djangocon 2014 angular + django
Djangocon 2014 angular + djangoDjangocon 2014 angular + django
Djangocon 2014 angular + djangoNina Zakharenko
 
Software Development with Open Source
Software Development with Open SourceSoftware Development with Open Source
Software Development with Open SourceOpusVL
 
REST Easy with AngularJS - ng-grid CRUD EXAMPLE
REST Easy with AngularJS - ng-grid CRUD EXAMPLEREST Easy with AngularJS - ng-grid CRUD EXAMPLE
REST Easy with AngularJS - ng-grid CRUD EXAMPLEreneechemel
 

What's hot (20)

Best Practices for WordPress
Best Practices for WordPressBest Practices for WordPress
Best Practices for WordPress
 
Develop webservice in PHP
Develop webservice in PHPDevelop webservice in PHP
Develop webservice in PHP
 
Scalable web application architecture
Scalable web application architectureScalable web application architecture
Scalable web application architecture
 
Advanced WordPress Development Environments
Advanced WordPress Development EnvironmentsAdvanced WordPress Development Environments
Advanced WordPress Development Environments
 
Building Your First App with MongoDB
Building Your First App with MongoDBBuilding Your First App with MongoDB
Building Your First App with MongoDB
 
Put a little Backbone in your WordPress
Put a little Backbone in your WordPressPut a little Backbone in your WordPress
Put a little Backbone in your WordPress
 
CouchDB for Web Applications - Erlang Factory London 2009
CouchDB for Web Applications - Erlang Factory London 2009CouchDB for Web Applications - Erlang Factory London 2009
CouchDB for Web Applications - Erlang Factory London 2009
 
The never-ending REST API design debate
The never-ending REST API design debateThe never-ending REST API design debate
The never-ending REST API design debate
 
Introduction to Plugin Programming, WordCamp Miami 2011
Introduction to Plugin Programming, WordCamp Miami 2011Introduction to Plugin Programming, WordCamp Miami 2011
Introduction to Plugin Programming, WordCamp Miami 2011
 
Differential Sync and JSON Patch @ SpringOne2GX 2014
Differential Sync and JSON Patch @ SpringOne2GX 2014Differential Sync and JSON Patch @ SpringOne2GX 2014
Differential Sync and JSON Patch @ SpringOne2GX 2014
 
Hypermedia: The Missing Element to Building Adaptable Web APIs in Rails
Hypermedia: The Missing Element to Building Adaptable Web APIs in RailsHypermedia: The Missing Element to Building Adaptable Web APIs in Rails
Hypermedia: The Missing Element to Building Adaptable Web APIs in Rails
 
Introducing RaveJS: Spring Boot concepts for JavaScript applications
Introducing RaveJS: Spring Boot concepts for JavaScript applicationsIntroducing RaveJS: Spring Boot concepts for JavaScript applications
Introducing RaveJS: Spring Boot concepts for JavaScript applications
 
REST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in CodeigniterREST API Best Practices & Implementing in Codeigniter
REST API Best Practices & Implementing in Codeigniter
 
Transforming WordPress Search and Query Performance with Elasticsearch
Transforming WordPress Search and Query Performance with Elasticsearch Transforming WordPress Search and Query Performance with Elasticsearch
Transforming WordPress Search and Query Performance with Elasticsearch
 
REST Web API with MongoDB
REST Web API with MongoDBREST Web API with MongoDB
REST Web API with MongoDB
 
Introduction to CouchDB
Introduction to CouchDBIntroduction to CouchDB
Introduction to CouchDB
 
Understanding and testing restful web services
Understanding and testing restful web servicesUnderstanding and testing restful web services
Understanding and testing restful web services
 
Djangocon 2014 angular + django
Djangocon 2014 angular + djangoDjangocon 2014 angular + django
Djangocon 2014 angular + django
 
Software Development with Open Source
Software Development with Open SourceSoftware Development with Open Source
Software Development with Open Source
 
REST Easy with AngularJS - ng-grid CRUD EXAMPLE
REST Easy with AngularJS - ng-grid CRUD EXAMPLEREST Easy with AngularJS - ng-grid CRUD EXAMPLE
REST Easy with AngularJS - ng-grid CRUD EXAMPLE
 

Viewers also liked

WordPress & A Mobile App
WordPress & A Mobile AppWordPress & A Mobile App
WordPress & A Mobile AppAmit K Sharma
 
マルチパブリッシング プラットフォームとしてのWordPress
マルチパブリッシング プラットフォームとしてのWordPressマルチパブリッシング プラットフォームとしてのWordPress
マルチパブリッシング プラットフォームとしてのWordPress文樹 高橋
 
WordPress and the Enterprise
WordPress and the EnterpriseWordPress and the Enterprise
WordPress and the EnterprisePrasad Ajinkya
 
Building WordPress sites with AngularJS and the RESTful plugin JSON API @ Dev...
Building WordPress sites with AngularJS and the RESTful plugin JSON API @ Dev...Building WordPress sites with AngularJS and the RESTful plugin JSON API @ Dev...
Building WordPress sites with AngularJS and the RESTful plugin JSON API @ Dev...Eric Greene
 
WordCamp Seoul: WordPress Based web services in Japan / WordCamp 서울 : 일본에서 워드...
WordCamp Seoul: WordPress Based web services in Japan / WordCamp 서울 : 일본에서 워드...WordCamp Seoul: WordPress Based web services in Japan / WordCamp 서울 : 일본에서 워드...
WordCamp Seoul: WordPress Based web services in Japan / WordCamp 서울 : 일본에서 워드...Shinichi Nishikawa
 
PHP classの教室
PHP classの教室PHP classの教室
PHP classの教室Yusuke Ando
 
第三章ナビゲーション &lt; 第4回デザイニング・インターフェース勉強会
第三章ナビゲーション &lt; 第4回デザイニング・インターフェース勉強会第三章ナビゲーション &lt; 第4回デザイニング・インターフェース勉強会
第三章ナビゲーション &lt; 第4回デザイニング・インターフェース勉強会Shinichi Nishikawa
 
CodaでClipを使ってWordPress開発を早くするススメ。
 CodaでClipを使ってWordPress開発を早くするススメ。 CodaでClipを使ってWordPress開発を早くするススメ。
CodaでClipを使ってWordPress開発を早くするススメ。Shinichi Nishikawa
 
WordPress中級者への道!テンプレートタグはどう動くのか!?
WordPress中級者への道!テンプレートタグはどう動くのか!?WordPress中級者への道!テンプレートタグはどう動くのか!?
WordPress中級者への道!テンプレートタグはどう動くのか!?Shinichi Nishikawa
 
8時間耐久CakePHP2 勉強会
8時間耐久CakePHP2 勉強会8時間耐久CakePHP2 勉強会
8時間耐久CakePHP2 勉強会Yusuke Ando
 
WordPress REST API hacking
WordPress REST API hackingWordPress REST API hacking
WordPress REST API hackingJeroen van Dijk
 
How to get your theme on Top 15 Popular Themes at WordPress.org
How to get your theme on Top 15 Popular Themes at WordPress.orgHow to get your theme on Top 15 Popular Themes at WordPress.org
How to get your theme on Top 15 Popular Themes at WordPress.orgCatch Themes
 
An easy guide to Plugin Development
An easy guide to Plugin DevelopmentAn easy guide to Plugin Development
An easy guide to Plugin DevelopmentShinichi Nishikawa
 
Getting Started With WP REST API
Getting Started With WP REST APIGetting Started With WP REST API
Getting Started With WP REST APIKishor Kumar
 
Design Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsDesign Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsStormpath
 

Viewers also liked (20)

WordPress & A Mobile App
WordPress & A Mobile AppWordPress & A Mobile App
WordPress & A Mobile App
 
マルチパブリッシング プラットフォームとしてのWordPress
マルチパブリッシング プラットフォームとしてのWordPressマルチパブリッシング プラットフォームとしてのWordPress
マルチパブリッシング プラットフォームとしてのWordPress
 
Demystifying the REST API
Demystifying the REST APIDemystifying the REST API
Demystifying the REST API
 
WordPress and the Enterprise
WordPress and the EnterpriseWordPress and the Enterprise
WordPress and the Enterprise
 
Building WordPress sites with AngularJS and the RESTful plugin JSON API @ Dev...
Building WordPress sites with AngularJS and the RESTful plugin JSON API @ Dev...Building WordPress sites with AngularJS and the RESTful plugin JSON API @ Dev...
Building WordPress sites with AngularJS and the RESTful plugin JSON API @ Dev...
 
WordCamp Seoul: WordPress Based web services in Japan / WordCamp 서울 : 일본에서 워드...
WordCamp Seoul: WordPress Based web services in Japan / WordCamp 서울 : 일본에서 워드...WordCamp Seoul: WordPress Based web services in Japan / WordCamp 서울 : 일본에서 워드...
WordCamp Seoul: WordPress Based web services in Japan / WordCamp 서울 : 일본에서 워드...
 
PHP classの教室
PHP classの教室PHP classの教室
PHP classの教室
 
第三章ナビゲーション &lt; 第4回デザイニング・インターフェース勉強会
第三章ナビゲーション &lt; 第4回デザイニング・インターフェース勉強会第三章ナビゲーション &lt; 第4回デザイニング・インターフェース勉強会
第三章ナビゲーション &lt; 第4回デザイニング・インターフェース勉強会
 
CodaでClipを使ってWordPress開発を早くするススメ。
 CodaでClipを使ってWordPress開発を早くするススメ。 CodaでClipを使ってWordPress開発を早くするススメ。
CodaでClipを使ってWordPress開発を早くするススメ。
 
WP REST API
WP REST APIWP REST API
WP REST API
 
WordCamp Tokyo 2012 Concept
WordCamp Tokyo 2012 ConceptWordCamp Tokyo 2012 Concept
WordCamp Tokyo 2012 Concept
 
WordPress中級者への道!テンプレートタグはどう動くのか!?
WordPress中級者への道!テンプレートタグはどう動くのか!?WordPress中級者への道!テンプレートタグはどう動くのか!?
WordPress中級者への道!テンプレートタグはどう動くのか!?
 
8時間耐久CakePHP2 勉強会
8時間耐久CakePHP2 勉強会8時間耐久CakePHP2 勉強会
8時間耐久CakePHP2 勉強会
 
WordPress REST API hacking
WordPress REST API hackingWordPress REST API hacking
WordPress REST API hacking
 
How to get your theme on Top 15 Popular Themes at WordPress.org
How to get your theme on Top 15 Popular Themes at WordPress.orgHow to get your theme on Top 15 Popular Themes at WordPress.org
How to get your theme on Top 15 Popular Themes at WordPress.org
 
Child Theme
Child ThemeChild Theme
Child Theme
 
An easy guide to Plugin Development
An easy guide to Plugin DevelopmentAn easy guide to Plugin Development
An easy guide to Plugin Development
 
Javantura v4 - True RESTful Java Web Services with JSON API and Katharsis - M...
Javantura v4 - True RESTful Java Web Services with JSON API and Katharsis - M...Javantura v4 - True RESTful Java Web Services with JSON API and Katharsis - M...
Javantura v4 - True RESTful Java Web Services with JSON API and Katharsis - M...
 
Getting Started With WP REST API
Getting Started With WP REST APIGetting Started With WP REST API
Getting Started With WP REST API
 
Design Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIsDesign Beautiful REST + JSON APIs
Design Beautiful REST + JSON APIs
 

Similar to JSON REST API for WordPress

JSON REST API for WordPress
JSON REST API for WordPressJSON REST API for WordPress
JSON REST API for WordPressTaylor Lovett
 
AtlasCamp2014: Introducing the Confluence REST API
AtlasCamp2014: Introducing the Confluence REST APIAtlasCamp2014: Introducing the Confluence REST API
AtlasCamp2014: Introducing the Confluence REST APIAtlassian
 
Designing a beautiful REST json api
Designing a beautiful REST json apiDesigning a beautiful REST json api
Designing a beautiful REST json api0x07de
 
WordPress APIs
WordPress APIsWordPress APIs
WordPress APIsmdawaffe
 
Finding Restfulness - Madrid.rb April 2014
Finding Restfulness - Madrid.rb April 2014Finding Restfulness - Madrid.rb April 2014
Finding Restfulness - Madrid.rb April 2014samlown
 
Building Better Web APIs with Rails
Building Better Web APIs with RailsBuilding Better Web APIs with Rails
Building Better Web APIs with RailsAll Things Open
 
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIsThe liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIsJorge Ferrer
 
2.28.17 Introducing DSpace 7 Webinar Slides
2.28.17 Introducing DSpace 7 Webinar Slides2.28.17 Introducing DSpace 7 Webinar Slides
2.28.17 Introducing DSpace 7 Webinar SlidesDuraSpace
 
Building APIs in an easy way using API Platform
Building APIs in an easy way using API PlatformBuilding APIs in an easy way using API Platform
Building APIs in an easy way using API PlatformAntonio Peric-Mazar
 
Have You Seen Spring Lately?
Have You Seen Spring Lately?Have You Seen Spring Lately?
Have You Seen Spring Lately?Joshua Long
 
FOXX - a Javascript application framework on top of ArangoDB
FOXX - a Javascript application framework on top of ArangoDBFOXX - a Javascript application framework on top of ArangoDB
FOXX - a Javascript application framework on top of ArangoDBArangoDB Database
 
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...Tom Johnson
 
ITB2016 - Building ColdFusion RESTFul Services
ITB2016 - Building ColdFusion RESTFul ServicesITB2016 - Building ColdFusion RESTFul Services
ITB2016 - Building ColdFusion RESTFul ServicesOrtus Solutions, Corp
 
Using the new WordPress REST API
Using the new WordPress REST APIUsing the new WordPress REST API
Using the new WordPress REST APICaldera Labs
 
Rest in practice
Rest in practiceRest in practice
Rest in practiceIan Brennan
 
Be a microservices hero
Be a microservices heroBe a microservices hero
Be a microservices heroOpenRestyCon
 
WordCamp Wilmington 2017 WP-API Why?
WordCamp Wilmington 2017   WP-API Why?WordCamp Wilmington 2017   WP-API Why?
WordCamp Wilmington 2017 WP-API Why?Evan Mullins
 
Big Data Web applications for Interactive Hadoop by ENRICO BERTI at Big Data...
 Big Data Web applications for Interactive Hadoop by ENRICO BERTI at Big Data... Big Data Web applications for Interactive Hadoop by ENRICO BERTI at Big Data...
Big Data Web applications for Interactive Hadoop by ENRICO BERTI at Big Data...Big Data Spain
 

Similar to JSON REST API for WordPress (20)

JSON REST API for WordPress
JSON REST API for WordPressJSON REST API for WordPress
JSON REST API for WordPress
 
AtlasCamp2014: Introducing the Confluence REST API
AtlasCamp2014: Introducing the Confluence REST APIAtlasCamp2014: Introducing the Confluence REST API
AtlasCamp2014: Introducing the Confluence REST API
 
Designing a beautiful REST json api
Designing a beautiful REST json apiDesigning a beautiful REST json api
Designing a beautiful REST json api
 
WordPress APIs
WordPress APIsWordPress APIs
WordPress APIs
 
Finding Restfulness - Madrid.rb April 2014
Finding Restfulness - Madrid.rb April 2014Finding Restfulness - Madrid.rb April 2014
Finding Restfulness - Madrid.rb April 2014
 
Building Better Web APIs with Rails
Building Better Web APIs with RailsBuilding Better Web APIs with Rails
Building Better Web APIs with Rails
 
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIsThe liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
 
2.28.17 Introducing DSpace 7 Webinar Slides
2.28.17 Introducing DSpace 7 Webinar Slides2.28.17 Introducing DSpace 7 Webinar Slides
2.28.17 Introducing DSpace 7 Webinar Slides
 
Web Services
Web ServicesWeb Services
Web Services
 
Building APIs in an easy way using API Platform
Building APIs in an easy way using API PlatformBuilding APIs in an easy way using API Platform
Building APIs in an easy way using API Platform
 
Have You Seen Spring Lately?
Have You Seen Spring Lately?Have You Seen Spring Lately?
Have You Seen Spring Lately?
 
REST easy with API Platform
REST easy with API PlatformREST easy with API Platform
REST easy with API Platform
 
FOXX - a Javascript application framework on top of ArangoDB
FOXX - a Javascript application framework on top of ArangoDBFOXX - a Javascript application framework on top of ArangoDB
FOXX - a Javascript application framework on top of ArangoDB
 
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
 
ITB2016 - Building ColdFusion RESTFul Services
ITB2016 - Building ColdFusion RESTFul ServicesITB2016 - Building ColdFusion RESTFul Services
ITB2016 - Building ColdFusion RESTFul Services
 
Using the new WordPress REST API
Using the new WordPress REST APIUsing the new WordPress REST API
Using the new WordPress REST API
 
Rest in practice
Rest in practiceRest in practice
Rest in practice
 
Be a microservices hero
Be a microservices heroBe a microservices hero
Be a microservices hero
 
WordCamp Wilmington 2017 WP-API Why?
WordCamp Wilmington 2017   WP-API Why?WordCamp Wilmington 2017   WP-API Why?
WordCamp Wilmington 2017 WP-API Why?
 
Big Data Web applications for Interactive Hadoop by ENRICO BERTI at Big Data...
 Big Data Web applications for Interactive Hadoop by ENRICO BERTI at Big Data... Big Data Web applications for Interactive Hadoop by ENRICO BERTI at Big Data...
Big Data Web applications for Interactive Hadoop by ENRICO BERTI at Big Data...
 

More from Taylor Lovett

WordPress Acceptance Testing, Solved!
WordPress Acceptance Testing, Solved!WordPress Acceptance Testing, Solved!
WordPress Acceptance Testing, Solved!Taylor Lovett
 
Best practices-wordpress-enterprise
Best practices-wordpress-enterpriseBest practices-wordpress-enterprise
Best practices-wordpress-enterpriseTaylor Lovett
 
Wordpress search-elasticsearch
Wordpress search-elasticsearchWordpress search-elasticsearch
Wordpress search-elasticsearchTaylor Lovett
 
Modernizing WordPress Search with Elasticsearch
Modernizing WordPress Search with ElasticsearchModernizing WordPress Search with Elasticsearch
Modernizing WordPress Search with ElasticsearchTaylor Lovett
 
What You Missed in Computer Science
What You Missed in Computer ScienceWhat You Missed in Computer Science
What You Missed in Computer ScienceTaylor Lovett
 
Saving Time with WP-CLI
Saving Time with WP-CLISaving Time with WP-CLI
Saving Time with WP-CLITaylor Lovett
 

More from Taylor Lovett (6)

WordPress Acceptance Testing, Solved!
WordPress Acceptance Testing, Solved!WordPress Acceptance Testing, Solved!
WordPress Acceptance Testing, Solved!
 
Best practices-wordpress-enterprise
Best practices-wordpress-enterpriseBest practices-wordpress-enterprise
Best practices-wordpress-enterprise
 
Wordpress search-elasticsearch
Wordpress search-elasticsearchWordpress search-elasticsearch
Wordpress search-elasticsearch
 
Modernizing WordPress Search with Elasticsearch
Modernizing WordPress Search with ElasticsearchModernizing WordPress Search with Elasticsearch
Modernizing WordPress Search with Elasticsearch
 
What You Missed in Computer Science
What You Missed in Computer ScienceWhat You Missed in Computer Science
What You Missed in Computer Science
 
Saving Time with WP-CLI
Saving Time with WP-CLISaving Time with WP-CLI
Saving Time with WP-CLI
 

Recently uploaded

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 

Recently uploaded (20)

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 

JSON REST API for WordPress

  • 1. JSON REST API for WordPress @tlovett12 + JSON REST API =
  • 2. Who Am I? • My name is Taylor Lovett! • Director of Web Engineering at 10up • Open source community member • WordPress core contributor • WP API team member @tlovett12
  • 3. We are hiring! @tlovett12
  • 4. So what’s this new WP API thing all about? Don’t we already have one?
  • 5. Right now, we have XML-RPC. It works but is extremely hard to use and outdated.
  • 6. Comparison to other WordPress API’s ! https://github.com/WP-API/WP-API/blob/ master/docs/comparison.md
  • 7. Why JSON REST API? • In a nutshell, JSON REST API’s have swept the web becoming an almost standard. They are extremely intuitive and provide an easy way to distribute, collect, and modify data. Let’s break it down a bit.
  • 8. JSON • JSON is an abbreviation for “JavaScript Object Notation” • It’s simply a way to describe data that is lightweight and extremely easy to use. Arguably much easier to use than XML.
  • 9. REST • REST (Representational State Transfer) is an architectural style that dictates how HTTP and URI’s should be used and organized. • Verbs and resources: GET /post/1 • Hypermedia as the Engine of Application State (HATEOAS) - Server provides everything you need to know how to use it in a response. • Actions are autonomous and do not depend on each other. • Bottom line: RESTful API’s have become extremely popular across the web. They are much easier to use than things like RPC or SOAP.
  • 10. And of course, API • An API (Application Programming Interface) is a set of entry points that allow you to interact with a platform (WordPress in this case).
  • 11. Ryan McCue and Contributors
  • 12. How can I start using it now?
  • 13. First, install the plugin http://wordpress.org/plugins/json-rest-api/ ! Core integration coming soon.
  • 14. What does the API allow me to do? /wp-json/ Shows all the routes and endpoints available /wp-json/posts Create, read, update, and delete posts /wp-json/users Create, read, update, and delete users /wp-json/media Create, read, update, and delete media items /wp-json/taxonomies Read taxonomies and terms /wp-json/pages/ Create, read, update, and delete pages
  • 15. The API is rich with functionality. Explore the documentation! http://wp-api.org/docs-development/ Let’s look at a few key endpoints.
  • 16. List Posts [{! "ID": 11297,! "title": "Post 19",! "status": "publish",! "type": "post",! "author": 1,! "content": "",! "parent": null,! "link": "http://example.com/2014/08/post-19/",! "format": "standard",! "slug": "post-19",! "guid": "http://example.com/2014/08/post-19/",! "excerpt": null,! "menu_order": 0,! "comment_status": "closed",! "ping_status": "open",! "sticky": false,! "meta": {},! "featured_image": null,! "terms": {}! }] GET /wp-json/posts
  • 17. List Posts Endpoint: /wp-json/posts Takes a number of useful parameters: • Filter[]: Accepts WP_Query arguments • Page: Allows for pagination • Context: Determines usage context i.e. “view or edit” • … https://github.com/WP-API/WP-API/blob/master/docs/routes/routes.md
  • 18. Retrieve A Post {! "ID": 11297,! "title": "Post 19",! "status": "publish",! "type": "post",! "author": 1,! "content": "",! "parent": null,! "link": "http://example.com/2014/08/post-19/",! "format": "standard",! "slug": "post-19",! "guid": "http://example.com/2014/08/post-19/",! "excerpt": null,! "menu_order": 0,! "comment_status": "closed",! "ping_status": "open",! "sticky": false,! "meta": {},! "featured_image": null,! "terms": {}! } GET /wp-json/posts/<id>
  • 19. Edit A Post PUT /wp-json/posts/<id> curl -X PUT -H “Content-Type: application/json” -d ‘! {! "title": “Updated Title",! “content_raw": “Updated post content"! }! ‘ -u admin:password http://example.com/wp-json/posts/<id> We need to send a PUT request to this endpoint with our post data. Of course we must authenticate before doing this.
  • 20. Three ways to authenticate • Cookie Authentication (client side) • HTTP Basic Authentication • OAuth 1
  • 21. HTTP Basic Authentication First install the WP Basic Auth Plugin: https://github.com/WP-API/Basic-Auth Remember this piece of our cURL request? -u admin:password That’s HTTP Basic Authentication! Essentially we are authenticating by passing an HTTP header like this: Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== Where that crazy looking string is username:password base64 encoded.
  • 22. HTTP Basic Authentication should only be used for testing!
  • 23. OAuth 1.0a First install the WP OAuth Plugin: https://github.com/WP-API/OAuth1 OAuth is outside of the scope of this talk. However, it should be used instead of HTTP Basic Auth when building external applications that interact with the API. Rather than giving someone an account on your site, you can give them temporary access with OAuth.
  • 24. Create A Post POST /wp-json/posts/ curl -X POST -H “Content-Type: application/json” -d ‘! {! "title": “Title",! “content_raw": “Post content"! }! ‘ -u admin:password http://example.com/wp-json/posts/ Notice we are using a POST request this time.
  • 25. Taxonomies GET /wp-json/taxonomies [! {! "name": "Categories",! "slug": "category",! "labels": {},! "types": { /* Registered post types */ },! "show_cloud": true,! "hierarchical": true,! "meta": {}! },! {! "name": "Tags",! "slug": "post_tag",! "labels": {},! "types": { /* Registered post types */ },! "show_cloud": true,! "hierarchical": false,! "meta": {}! }! }! ]
  • 26. Taxonomy GET /wp-json/taxonomies/<taxonomy> {! "name": "Categories",! "slug": "category",! "labels": {},! "types": { /* Registered post types */ },! "show_cloud": true,! "hierarchical": true,! "meta": {}! }
  • 27. Taxonomy Terms GET /wp-json/taxonomies/<taxonomy>/terms [! {! "ID": 1,! "name": "Books",! "slug": "books",! "description": "",! "parent": null,! "count": 1,! "link": "http://example.com/category/books/",! "meta": {}! },! {! "ID": 2,! "name": "Products",! "slug": "products",! "description": "",! "parent": null,! "count": 1,! "link": "http://example.com/category/products/",! "meta": {}! }! ]
  • 28. Build Your Own Routes and Endpoints WP API is very extensible (custom post types!) http://wp-api.org/guides/extending.html
  • 29. What can I do with the JSON REST API for WordPress?
  • 30. JavaScript Interact with your (or someone else’s) WordPress install with JavaScript. Backbone.js Client: https://github.com/WP-API/client-js ! ! Node.js Client: https://github.com/kadamwhite/wordpress-rest-api !
  • 31. Backbone.js • Backbone.js is a JavaScript framework that lets you structure code in terms of models, views, and collections. It works great with RESTful JSON API’s.
  • 32. _s_backbone • _s or underscores is a popular starter theme by Automattic: https://github.com/automattic/_s • _s_backbone is an _s fork that powers post loops using the WP API Backbone client
  • 34. What does this mean? • It means _s_backbone is a starter theme with infinite scroll built-in using the WP API Backbone client. • Infinite scroll is the concept of loading multiple rounds of entities without reloading the page. Let’s look at some code!
  • 35. This is some JavaScript you could add to a theme or plugin to display your site’s posts. You will first need to have JSON REST API for WordPress installed and the “wp-api” JavaScript dependency enqueued. functions.php: js/scripts.js:
  • 36. If you learned nothing so far, know this: You can do amazing things with the JSON REST API for WordPress. With core integration and ~23% of the web using this API in the near future, you will have much easier access to data across the web.
  • 37. Questions? @tlovett12! taylor.lovett@10up.com! taylorlovett.com We need to send a PUT request to this endpoint with our post data. Of course we must authenticate before doing this.