Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Jack Lenox - Intro to the REST API - WordCamp A...
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
WordPress Greek Community
PRO
November 19, 2016
Programming
400
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
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
49
Orestis Samaras - Modern WordPress Development with Composer
wpgr
PRO
0
34
Eleni Tsertou - Ταχύτερο website με Persistent Object Cache: Μύθος ή Αλήθεια;
wpgr
PRO
0
37
George Korakas - WordPress Security 2025: From Real Threats to Practical Defenses
wpgr
PRO
0
46
Δημήτρης Καρβούνης - Πέρα από το Admin Panel: Πώς να μιλήσεις στο WordPress σαν Developer μέσω REST API
wpgr
PRO
0
30
Αναστασία Αδαμούδη - Δημιουργία σύνθετου μενού πλοήγησης σε block θέματα
wpgr
PRO
0
23
Νίκος Μαυράκης - Κοστολογώντας τη δημιουργικότητα
wpgr
PRO
0
46
Jovana Smoljanovic Tucakov - AI vs. Human Content: What Works, What Backfires, and What’s Next
wpgr
PRO
0
45
Λεωνίδας Μηλώσης - Optimize – optimize – optimize: Caring for performance of your WordPress plugin or website
wpgr
PRO
0
36
Other Decks in Programming
See All in Programming
『コードを書く以外の』エンジニアリング〜課金基盤移行プロジェクト推進のためのTips4選
yuriko1211
0
590
freee が目指す データ マネジメント戦略 AI-Ready 時代を支える 攻めのガバナンスとは
freee
PRO
0
330
Apache Hive: そしてCloud Native Lakehouseへ
okumin
1
220
ドリフトを絶対に許さない(?)CDK運用 / CDK Ops with Zero Tolerance for Drifts (?)
akihisaikeda
1
180
Terraform標準の組織で AWS CDKをどう使うか
mu7889yoon
1
500
Android CLI
fornewid
0
220
プロポーザルを書いてもらう
pvcresin
0
300
Claude CodeとAgentCore Gatewayを繋ぐ際の認証認可 / Authentication and authorization when connecting Claude Code with AgentCore Gateway
har1101
2
270
ビデオ通話が繋がる0.2秒で何が起きているのか
supurazako
2
180
SlackアプリとLambdaの 連携を構築した話
pawn_4_s
1
110
改善しないと、タスクが回らない。 “てんこ盛りポジション” を引き継いだ情シスの、入社3ヶ月の業務改善録
krm963
0
260
the container ship “Apple Silicon”@WWDC26 Recap -Japan-\(region).swift
shingangan
0
120
Featured
See All Featured
Believing is Seeing
oripsolob
1
180
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
2
3.7k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Bash Introduction
62gerente
615
220k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
ラッコキーワード サービス紹介資料
rakko
1
4.3M
Why Our Code Smells
bkeepers
PRO
340
58k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
700
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
400
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
640
Music & Morning Musume
bryan
47
7.3k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
380
Transcript
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