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
Nate Abele
August 30, 2013
Programming
1
210
REST API Design, Part II
Given at PHP Undiscovered, SF.
Nate Abele
August 30, 2013
Tweet
Share
More Decks by Nate Abele
See All by Nate Abele
Running Kubernetes in the Browser. Yes, really. Not really. Kind of.
nateabele
1
49
Un-dux Your Front-End
nateabele
1
110
CloudFormation For Fun & Profit (But Mostly Sanity)
nateabele
0
78
Functional Reactive Systems
nateabele
1
140
ngPittsburgh - AngularUI Router Philosophy
nateabele
1
1.1k
The Future of Programming
nateabele
1
510
Past, Present, and Future: The Evolution of PHP Development
nateabele
1
580
The Future of Programming: PHP Argentina 2014
nateabele
1
120
Designing Hypermedia APIs
nateabele
4
670
Other Decks in Programming
See All in Programming
脱Riverpod?fqueryで考える、TanStack Queryライクなアーキテクチャの可能性
ostk0069
0
500
状態遷移図を書こう / Sequence Chart vs State Diagram
orgachem
PRO
2
200
High-Level Programming Languages in AI Era -Human Thought and Mind-
hayat01sh1da
PRO
0
880
『自分のデータだけ見せたい!』を叶える──Laravel × Casbin で複雑権限をスッキリ解きほぐす 25 分
akitotsukahara
2
660
AI駆動のマルチエージェントによる業務フロー自動化の設計と実践
h_okkah
0
230
明示と暗黙 ー PHPとGoの インターフェイスの違いを知る
shimabox
2
620
リバースエンジニアリング新時代へ! GhidraとClaude DesktopをMCPで繋ぐ/findy202507
tkmru
3
960
What's new in AppKit on macOS 26
1024jp
0
150
MDN Web Docs に日本語翻訳でコントリビュートしたくなる
ohmori_yusuke
1
130
Claude Code派?Gemini CLI派? みんなで比較LT会!_20250716
junholee
1
530
Porting a visionOS App to Android XR
akkeylab
0
680
dbt民主化とLLMによる開発ブースト ~ AI Readyな分析サイクルを目指して ~
yoshyum
3
1.1k
Featured
See All Featured
Faster Mobile Websites
deanohume
308
31k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
Balancing Empowerment & Direction
lara
1
450
GitHub's CSS Performance
jonrohan
1031
460k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
How to Ace a Technical Interview
jacobian
278
23k
Git: the NoSQL Database
bkeepers
PRO
430
65k
A Modern Web Designer's Workflow
chriscoyier
695
190k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.4k
Embracing the Ebb and Flow
colly
86
4.8k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
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