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
48
Un-dux Your Front-End
nateabele
1
110
CloudFormation For Fun & Profit (But Mostly Sanity)
nateabele
0
78
Functional Reactive Systems
nateabele
1
140
ngPittsburgh - AngularUI Router Philosophy
nateabele
1
1.1k
The Future of Programming
nateabele
1
510
Past, Present, and Future: The Evolution of PHP Development
nateabele
1
580
The Future of Programming: PHP Argentina 2014
nateabele
1
120
Designing Hypermedia APIs
nateabele
4
670
Other Decks in Programming
See All in Programming
ソフトウェア品質を数字で捉える技術。事業成長を支えるシステム品質の マネジメント
takuya542
1
13k
ふつうの技術スタックでアート作品を作ってみる
akira888
1
820
MDN Web Docs に日本語翻訳でコントリビュートしたくなる
ohmori_yusuke
1
120
Rubyでやりたい駆動開発 / Ruby driven development
chobishiba
1
700
#QiitaBash MCPのセキュリティ
ryosukedtomita
1
1.3k
Webの外へ飛び出せ NativePHPが切り拓くPHPの未来
takuyakatsusa
2
550
PicoRuby on Rails
makicamel
2
130
明示と暗黙 ー PHPとGoの インターフェイスの違いを知る
shimabox
2
510
Railsアプリケーションと パフォーマンスチューニング ー 秒間5万リクエストの モバイルオーダーシステムを支える事例 ー Rubyセミナー 大阪
falcon8823
5
1.1k
AI コーディングエージェントの時代へ:JetBrains が描く開発の未来
masaruhr
1
140
Team operations that are not burdened by SRE
kazatohiei
1
310
Systèmes distribués, pour le meilleur et pour le pire - BreizhCamp 2025 - Conférence
slecache
0
120
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
RailsConf 2023
tenderlove
30
1.1k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
5.9k
Making Projects Easy
brettharned
116
6.3k
We Have a Design System, Now What?
morganepeng
53
7.7k
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.4k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
48
2.9k
The Pragmatic Product Professional
lauravandoore
35
6.7k
A Modern Web Designer's Workflow
chriscoyier
695
190k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
5.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/