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 I
Search
Nate Abele
August 29, 2013
Programming
1
210
REST API Design, Part I
Given at PHP Undiscovered, SF.
Nate Abele
August 29, 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
53
Un-dux Your Front-End
nateabele
1
110
CloudFormation For Fun & Profit (But Mostly Sanity)
nateabele
0
78
Functional Reactive Systems
nateabele
1
150
ngPittsburgh - AngularUI Router Philosophy
nateabele
1
1.1k
The Future of Programming
nateabele
1
520
Past, Present, and Future: The Evolution of PHP Development
nateabele
1
590
The Future of Programming: PHP Argentina 2014
nateabele
1
120
Designing Hypermedia APIs
nateabele
4
680
Other Decks in Programming
See All in Programming
Introducing ReActionView: A new ActionView-compatible ERB Engine @ Rails World 2025, Amsterdam
marcoroth
0
690
アセットのコンパイルについて
ojun9
0
130
testingを眺める
matumoto
1
140
意外と簡単!?フロントエンドでパスキー認証を実現する WebAuthn
teamlab
PRO
2
760
FindyにおけるTakumi活用と脆弱性管理のこれから
rvirus0817
0
510
はじめてのMaterial3 Expressive
ym223
2
740
速いWebフレームワークを作る
yusukebe
5
1.7k
旅行プランAIエージェント開発の裏側
ippo012
2
910
「待たせ上手」なスケルトンスクリーン、 そのUXの裏側
teamlab
PRO
0
530
パッケージ設計の黒魔術/Kyoto.go#63
lufia
3
440
@Environment(\.keyPath)那么好我不允许你们不知道! / atEnvironment keyPath is so good and you should know it!
lovee
0
120
AI時代のUIはどこへ行く?
yusukebe
18
8.9k
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1370
200k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.7k
Context Engineering - Making Every Token Count
addyosmani
3
46
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
126
53k
Designing for humans not robots
tammielis
253
25k
Writing Fast Ruby
sferik
628
62k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
139
34k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.9k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
How to train your dragon (web standard)
notwaldorf
96
6.2k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
2.9k
Transcript
RESTFUL API DESIGN
Every time someone mentions RESTful web services, there’s always that
one person that has to chime in: “That’s not really RESTful, it’s just kinda RESTful.” — Steve Klabnik
THE RICHARDSON MATURITY MODEL • Level 0: RPC over HTTP
• Level 1: Resources vs. single service endpoint • Level 2: HTTP Verbs vs. URL-based method calls • Level 3: Hypermedia controls
BASICALLY, A CONTENT-NEGOTIATED STATE MACHINE
<link rel="stylesheet" href="default.css" type="text/css" title="Default Style" />
<form method="POST" action="/items"> <input type="text" name="title" /> </form>
<link rel="next" href="/next" type="content/type" title="Next!" />
MEANINGFUL RESPONSE CODES • 201: Created • 202: We’ll get
back to you • 304: Use the copy I gave you last time • 400: WTF URL parameters • 401: Authentication • 403: Access control
MEANINGFUL RESPONSE CODES • 406: I refuse to speak XML
• 410: Soft deletes • 415: I refuse to listen to XML • 418: Useless, I wanted coffee • 422: Validation failed • 429: Chill out • 451: Legal told me not to • 503: Network/database/dependent service issues
SCALE
VERSIONING?
application/vnd.my-company.app+json; version=2.2 ? X-Version: 2.2 ?
INTENTS
http://api.fbi.gov/wanted? order_by=notoriety,desc& limit=10& page=1& fields=name,aka,known_associates, reward,description,last_seen vs. http://api.fbi.gov/wanted/most https://mathieu.fenniak.net/stop-designing-fragile-web-apis/