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
Un-dux Your Front-End
nateabele
1
90
CloudFormation For Fun & Profit (But Mostly Sanity)
nateabele
0
57
Functional Reactive Systems
nateabele
1
130
ngPittsburgh - AngularUI Router Philosophy
nateabele
1
950
The Future of Programming
nateabele
1
390
Past, Present, and Future: The Evolution of PHP Development
nateabele
1
420
The Future of Programming: PHP Argentina 2014
nateabele
1
100
Designing Hypermedia APIs
nateabele
4
600
REST API Design, Part II
nateabele
1
190
Other Decks in Programming
See All in Programming
⼤規模⾔語モデルの拡張(RAG)が 終わったかも知れない件について
nearme_tech
23
15k
PHPの次期バージョンはこの時期どうなっているのか - Internalsの開発体制について - PHPカンファレンス小田原
youkidearitai
PRO
1
190
Komplexe Oberflächen mit SVG und der Web Animation API
joergneumann
0
670
GitHub Copilotのススメ
marcy731
1
200
dbtのドメイン分割による データ基盤の改善とDigdagとの連携
sakama
0
360
大規模Reactアプリのリアーキテクチャ~8万行のTanStack Query移行の軌跡~
kj455
4
970
R言語の環境構築と基礎 Tokyo.R 112
bob3bob3
0
270
2 週間で Twitter Bot を作ってみた
contour_gara
0
560
TCAとKMPを用いた新規動画配信アプリ 「ABEMA Live」の設計
tomu28
1
110
二郎系ラーメンのコールで学ぶ AST 解析
memory1994
PRO
7
1.7k
Goのエラースタックトレースの歴史と今後
sonatard
9
1.5k
Ruby GitHub Packages
bkuhlmann
0
630
Featured
See All Featured
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
187
16k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
2
3.4k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
241
1.2M
Thoughts on Productivity
jonyablonski
58
3.8k
Designing Experiences People Love
moore
136
23k
A better future with KSS
kneath
231
16k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
14
1.5k
Build your cross-platform service in a week with App Engine
jlugia
225
17k
No one is an island. Learnings from fostering a developers community.
thoeni
16
2.1k
VelocityConf: Rendering Performance Case Studies
addyosmani
320
23k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
2
1.3k
Fontdeck: Realign not Redesign
paulrobertlloyd
76
4.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/