Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Jack Lenox - Intro to the REST API - WordCamp A...
Search
WordPress Greek Community
PRO
November 19, 2016
Programming
410
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Jack Lenox - Intro to the REST API - WordCamp Athens 2016
WordPress Greek Community
PRO
November 19, 2016
Transcript
36 slides
An introduc on to the WordPress REST API Jack Lenox
(@jacklenox) WordCamp Athens 2016
I Greece!
1. The case for a WordPress REST API
What is a REST API?
It stands for REpresenta onal State Transfer Applica on Programming
Interface
Centred around verbs GET POST UPDATE PUT DELETE etc. Different
ways to interact with your data
Usually responds in XML or JSON format XML (Extensible Markup
Language) HTML RSS JSON (JavaScript Object Notation)
Why does WordPress need one?
None
MoMA in New York (c. 2009) Their developers wanted to
use: WordPress as the CMS Ruby to build the front-end Why? I don't know... but they did
None
None
None
Internet of things
So, what is the WordPress REST API?
None
None
Merge meline WordPress 4.4 (8 December 2015) Infrastructure merged No
endpoints WordPress 4.7 (due 6 December 2016) Endpoints merged!
2. How the WordPress REST API works (aka, what the
heck is an endpoint?)
End‐what? REST APIs interprets a URL, and return a response
Not wildly different to RSS Sample request to fetch some posts: wc-athens.dev/wp-json/wp/v2/posts
[ { "id": 1, "date": "2016-11-18T14:08:53", "date_gmt": "2016-11-18T14:08:53", "modified": "2016-11-18T14:08:53",
"modified_gmt": "2016-11-18T14:08:53", "slug": "hello-world", "type": "post", "link": "http://wp-rest-api-demo.dev/2016/11/18/hello-wor "title": { "rendered": "Hello world!" }, "content": { "rendered": "<p>Welcome to WordPress. This is your fi "protected": false } } ]
More endpoints... Single post: wc-athens.dev/wp-json/wp/v2/posts/1 All pages: wc-athens.dev/wp-json/wp/v2/pages All users:
wc-athens.dev/wp-json/wp/v2/users All categories: wc-athens.dev/wp-json/wp/v2/categories
Moar verbs! By default, our calls to the REST API
are GET requests. But we can do a lot more: POST PUT UPDATE DELETE
Authen ca on!
A few ways to authen cate Basic Authen ca on
Quick and dirty Cookie Authen ca on Good, especially for themes and plugins OAuth 1.0 A bit complicated, but versatile OAuth 2 Less complicated than OAuth 1, but requires HTTPS
Brokered Authen ca on apps.wp-api.org
Modifying endpoints
3. Uses for the WordPress REST API
Custom wp‐admin interfaces Calypso HappyTables
Mobile applica ons WordPress apps for iOS and Android Vienna
Themes Picard Anadama Foxhound
Plugins WooCommerce Syndication EDD
Enterprise Guggenheim Quartz Google IO (not WordPress, but...)
Very exci ng mes ahead!
Further reading, and any ques ons? v2.wp-api.org WordPress.tv (search "REST
API") javascriptforwp.com
Ευχαριστώ πολύ! @jacklenox
More Decks by WordPress Greek Community
See All by WordPress Greek Community
Filippos Karailanidis - Beyond ChatGPT: AI Toolkit for the WordPress Developer
wpgr
PRO
0
65
Orestis Samaras - Modern WordPress Development with Composer
wpgr
PRO
0
55
Eleni Tsertou - Ταχύτερο website με Persistent Object Cache: Μύθος ή Αλήθεια;
wpgr
PRO
0
50
George Korakas - WordPress Security 2025: From Real Threats to Practical Defenses
wpgr
PRO
0
68
Δημήτρης Καρβούνης - Πέρα από το Admin Panel: Πώς να μιλήσεις στο WordPress σαν Developer μέσω REST API
wpgr
PRO
0
51
Αναστασία Αδαμούδη - Δημιουργία σύνθετου μενού πλοήγησης σε block θέματα
wpgr
PRO
0
31
Νίκος Μαυράκης - Κοστολογώντας τη δημιουργικότητα
wpgr
PRO
0
63
Jovana Smoljanovic Tucakov - AI vs. Human Content: What Works, What Backfires, and What’s Next
wpgr
PRO
0
79
Λεωνίδας Μηλώσης - Optimize – optimize – optimize: Caring for performance of your WordPress plugin or website
wpgr
PRO
0
54
Other Decks in Programming
See All in Programming
LLM 101: Exploring LLMs, Starting with Tokens.
dalinaum
0
120
React Native経験者が Flutterを30⽇間触って驚いたこと
3saito
0
210
Going Full Circle with Virtual Graphs and Relational Databases
michaelsimons
1
110
SODA - FACT BOOK(EN)
sodainc
1
290
Claude Codeのおかげでやりたいことがやれるようになったんだよォー!
sms_tech
0
190
How SRE Grew Out of Server-Side Work and Became the Team's Own / サーバサイドから始まったSREを チームに渡すまで
maaaato
1
260
どうしても Eloquent でリポジトリパターンをやりたいんだ #phpcon_niigata / phpcon-niigata-2026
shogogg
0
690
Growing PicoRuby's Ecosystem on ESP32
yuuu
2
150
protojson における文字化けの扱い
kazuki1023
0
460
Apache Airflow Introduction
leew
1
100
ローカルLLMの基本と近況 2611 / Local LLM basics and recent situation 2611
kishida
3
660
作れるエンジニアから、価値を届けるエンジニアへ
ryunakayama
1
950
Featured
See All Featured
エンジニアに許された特別な時間の終わり
watany
109
250k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
340
HDC tutorial
michielstock
2
1k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
470
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.8k
Context Engineering - Making Every Token Count
addyosmani
9
1.3k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
890
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.9k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
Intergalactic Javascript Robots from Outer Space
tanoku
273
28k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
750