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
40
Un-dux Your Front-End
nateabele
1
100
CloudFormation For Fun & Profit (But Mostly Sanity)
nateabele
0
75
Functional Reactive Systems
nateabele
1
140
ngPittsburgh - AngularUI Router Philosophy
nateabele
1
1.1k
The Future of Programming
nateabele
1
500
Past, Present, and Future: The Evolution of PHP Development
nateabele
1
570
The Future of Programming: PHP Argentina 2014
nateabele
1
120
Designing Hypermedia APIs
nateabele
4
660
Other Decks in Programming
See All in Programming
從零到一:搭建你的第一個 Observability 平台
blueswen
0
200
TypeScript Language Service Plugin で CSS Modules の開発体験を改善する
mizdra
PRO
3
2.4k
try-catchを使わないエラーハンドリング!? PHPでResult型の考え方を取り入れてみよう
kajitack
3
240
Blueskyのプラグインを作ってみた
hakkadaikon
1
270
AIエージェントによるテストフレームワーク Arbigent
takahirom
0
260
コンポーネントライブラリで実現する、アクセシビリティの正しい実装パターン
schktjm
1
660
人には人それぞれのサービス層がある
shimabox
3
460
CRUD から CQRS へ ~ 分離が可能にする柔軟性
tkawae
0
220
RubyKaigi Hack Space in Tokyo & 函館最速 "予習" 会 / RubyKaigi Hack Space in Tokyo & The Fastest Briefing of RubyKaigi 2026 in Hakodate
moznion
1
120
ワンバイナリWebサービスのススメ
mackee
10
7.4k
Perlで痩せる
yuukis
1
650
Agent Rules as Domain Parser
yodakeisuke
1
330
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
133
9.3k
The Art of Programming - Codeland 2020
erikaheidi
54
13k
A designer walks into a library…
pauljervisheath
205
24k
Designing for humans not robots
tammielis
253
25k
Git: the NoSQL Database
bkeepers
PRO
430
65k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
42
2.3k
How GitHub (no longer) Works
holman
314
140k
Facilitating Awesome Meetings
lara
54
6.4k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.1k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.6k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
460
Why Our Code Smells
bkeepers
PRO
336
57k
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/