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
REST API Design, Part II
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Nate Abele
August 30, 2013
Programming
230
1
Share
REST API Design, Part II
Given at PHP Undiscovered, SF.
Nate Abele
August 30, 2013
More Decks by Nate Abele
See All by Nate Abele
Running Kubernetes in the Browser. Yes, really. Not really. Kind of.
nateabele
1
73
Un-dux Your Front-End
nateabele
1
150
CloudFormation For Fun & Profit (But Mostly Sanity)
nateabele
0
88
Functional Reactive Systems
nateabele
1
180
ngPittsburgh - AngularUI Router Philosophy
nateabele
1
1.2k
The Future of Programming
nateabele
1
580
Past, Present, and Future: The Evolution of PHP Development
nateabele
1
640
The Future of Programming: PHP Argentina 2014
nateabele
1
130
Designing Hypermedia APIs
nateabele
4
710
Other Decks in Programming
See All in Programming
t *testing.T は どこからやってくるの?
otakakot
1
820
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
250
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
2
150
JAWS-UG横浜 #100 祝・第100回スペシャルAWS は VPC レスの時代へ
maroon1st
0
190
WebAssembly を読み込むベストプラクティス 2026年春版 / Best Practices for Loading WebAssembly (Spring 2026)
petamoriken
4
900
感情を設計する
ichimichi
5
1.6k
10年分の技術的負債、完済へ ― Claude Code主導のAI駆動開発でスポーツブルを丸ごとリプレイスした話
takuya_houshima
0
2.7k
Going Multiplatform with Your Android App (Android Makers 2026)
zsmb
2
460
エラー処理の温故知新 / history of error handling technic
ryotanakaya
7
1.7k
Agentic Elixir
whatyouhide
0
420
How We Benchmarked Quarkus: Patterns and anti-patterns
hollycummins
1
160
Offline should be the norm: building local-first apps with CRDTs & Kotlin Multiplatform
renaudmathieu
0
230
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1370
200k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
140
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
270
Why Our Code Smells
bkeepers
PRO
340
58k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.5k
Designing Powerful Visuals for Engaging Learning
tmiket
1
350
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
350
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.1k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
160
For a Future-Friendly Web
brad_frost
183
10k
Transcript
The Dream of the 90’s is Withering on the Vine
(in Portland)
How to Future-Proof & Increase The Level of Sanity in
the Design of Your APIs, by Respecting the Best Practices of HTTP Or...
This is Roy
Principles • Client-Server • Stateless • Cacheable • Uniform Interface
• Opaque Layering • Code-on-Demand
Objectives •Auth •Querying •Relationships •Pagination •Formats •Caching •Logging •API Versioning
Auth •Simple! •Basic vs. Digest (over SSL, obviously) •Upshot of
Basic: http://user:
[email protected]
/objects •Cookies? •Custom Tokens?
Querying •There are approaches to making this discoverable •They are
ridiculously ivory-tower •Better: ?q=<whatever>
Relationships •Goal: Introspect API domain model and transform object relationships
to URLs
Relationships GET /tasks HTTP/1.1 [{ title: "Finish client demo", completed:
false, _links: { self: { href: "http://my.app/tasks/1138" }, owner: { href: "http://my.app/users/nate" }, subtasks: { href: "http://my.app/tasks/1138/subtasks" } } }]
Pagination GET /tasks?page=5&order=due ?
Pagination HTTP Range! GET /videos/rickroll.mp4 Range: bytes=100-99999
Pagination HEAD /tasks HTTP/1.1 ... HTTP 200 OK Accept-Ranges: tasks
Pagination HEAD /posts HTTP/1.1 ... HTTP 200 OK Accept-Ranges: posts
Pagination GET /posts HTTP/1.1 Range: posts=1-20
Caching (Strategies) • Generated cache keys (ETag, If-None-Match) • For
writes: If-Match • Time-based (Last-Modified / If-Modified-Since)
Logging Custom Response Headers!
Logging X-Query-Log: SELECT * From users WHERE name = "nate"
X-Query-Log: SELECT * From tasks WHERE user_id = 13
Logging X-Query-Log: users.find({ name: "nate" })
DEMO