Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
220
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
59
Un-dux Your Front-End
nateabele
1
120
CloudFormation For Fun & Profit (But Mostly Sanity)
nateabele
0
81
Functional Reactive Systems
nateabele
1
160
ngPittsburgh - AngularUI Router Philosophy
nateabele
1
1.1k
The Future of Programming
nateabele
1
540
Past, Present, and Future: The Evolution of PHP Development
nateabele
1
610
The Future of Programming: PHP Argentina 2014
nateabele
1
120
Designing Hypermedia APIs
nateabele
4
690
Other Decks in Programming
See All in Programming
WebRTC、 綺麗に見るか滑らかに見るか
sublimer
1
140
CloudNative Days Winter 2025: 一週間で作る低レイヤコンテナランタイム
ternbusty
7
1.9k
『実践MLOps』から学ぶ DevOps for ML
nsakki55
2
550
How Software Deployment tools have changed in the past 20 years
geshan
0
27k
大体よく分かるscala.collection.immutable.HashMap ~ Compressed Hash-Array Mapped Prefix-tree (CHAMP) ~
matsu_chara
1
210
社内オペレーション改善のためのTypeScript / TSKaigi Hokuriku 2025
dachi023
1
470
connect-python: convenient protobuf RPC for Python
anuraaga
0
350
Full-Cycle Reactivity in Angular: SignalStore mit Signal Forms und Resources
manfredsteyer
PRO
0
180
dotfiles 式年遷宮 令和最新版
masawada
1
670
Reactive Thinking with Signals and the new Resource API
manfredsteyer
PRO
0
160
AWS CDKの推しポイントN選
akihisaikeda
1
240
All(?) About Point Sets
hole
0
260
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.3k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Six Lessons from altMBA
skipperchong
29
4.1k
Leading Effective Engineering Teams in the AI Era
addyosmani
8
1.2k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.6k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.4k
KATA
mclloyd
PRO
32
15k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
Why Our Code Smells
bkeepers
PRO
340
57k
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