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
200
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
12
Un-dux Your Front-End
nateabele
1
94
CloudFormation For Fun & Profit (But Mostly Sanity)
nateabele
0
61
Functional Reactive Systems
nateabele
1
140
ngPittsburgh - AngularUI Router Philosophy
nateabele
1
1k
The Future of Programming
nateabele
1
440
Past, Present, and Future: The Evolution of PHP Development
nateabele
1
490
The Future of Programming: PHP Argentina 2014
nateabele
1
110
Designing Hypermedia APIs
nateabele
4
620
Other Decks in Programming
See All in Programming
全部見せます! クラシルリワードのSwiftTesting移行プロジェクト
uetyo
0
210
Kotlin 2.0 and Beyond
antonarhipov
2
150
GoのIteratorに詳しくなってしまう
inatonix
1
210
[DroidKaigi 2024] Android ViewからJetpack Composeへ 〜Jetpack Compose移行のすゝめ〜 / From Android View to Jetpack Compose: A Guide to Migration
syarihu
1
690
【TID2024】模擬講義:プログラマと一緒にゲームをデザインしてみよう!
akatsukigames_tech
0
680
上手に付き合うコンポーネントテスト
quramy
1
260
What is Parser
yui_knk
9
4.2k
Rubyとクリエイティブコーディングの輪の広がり / The Growing Circle of Ruby and Creative Coding
chobishiba
1
270
Modern Angular with the NGRX Signal Store New Rules for Your Architecture @BASTA! 2024 in Mainz
manfredsteyer
PRO
0
170
Using Livebook to build and deploy internal tools @ ElixirConf 2024
hugobarauna
0
250
GenU導入でCDKに初挑戦し、悪戦苦闘した話
hideg
0
170
Architecture Decision Record (ADR)
nearme_tech
PRO
1
700
Featured
See All Featured
Happy Clients
brianwarren
96
6.6k
BBQ
matthewcrist
83
9.2k
Into the Great Unknown - MozCon
thekraken
29
1.4k
Rails Girls Zürich Keynote
gr2m
93
13k
What's new in Ruby 2.0
geeforr
340
31k
YesSQL, Process and Tooling at Scale
rocio
167
14k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
109
6.9k
No one is an island. Learnings from fostering a developers community.
thoeni
18
2.9k
Designing the Hi-DPI Web
ddemaree
278
34k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
29
2.6k
Why You Should Never Use an ORM
jnunemaker
PRO
53
9k
Designing on Purpose - Digital PM Summit 2013
jponch
114
6.8k
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/