Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
API Design at Eventbrite
Andrew Godwin
April 10, 2014
Programming
2
2.5k
API Design at Eventbrite
A short talk given as part of the Eventbrite "Advanced Django" workshop at Pycon 2014
Andrew Godwin
April 10, 2014
Tweet
Share
More Decks by Andrew Godwin
See All by Andrew Godwin
Writing Maintainable Software At Scale
andrewgodwin
0
180
A Newcomer's Guide To Airflow's Architecture
andrewgodwin
0
150
Async, Python, and the Future
andrewgodwin
2
430
How To Break Django: With Async
andrewgodwin
1
420
Taking Django's ORM Async
andrewgodwin
0
400
The Long Road To Asynchrony
andrewgodwin
0
420
The Scientist & The Engineer
andrewgodwin
1
440
Pioneering Real-Time
andrewgodwin
0
190
Just Add Await: Retrofitting Async Into Django
andrewgodwin
2
1.2k
Other Decks in Programming
See All in Programming
和暦を正しく扱うための暦の話
nagise
10
4.6k
Form実装基本を学び直してみた
hyugatsukui
0
200
AWSとCPUのムフフな関係
cmdemura
0
440
MapLibre GL JS とCSSアニメーションでできること
satoshi7190
0
200
様々なWebアプリをAzureにデプロイする
tomokusaba
0
110
How to Fight Production Incidents?
asatarin
0
140
10年以上続くプロダクトの フロントエンド刷新プロジェクトのふりかえり
yotahada3
2
290
23年のJavaトレンドは?Quarkusで理解するコンテナネイティブJava
tatsuya1bm
1
110
ipa-medit: Memory search and patch tool for IPA without Jailbreaking/ipa-medit-bh2022-europe
tkmru
0
130
T3 Stack and TypeScript ecosystem
quramy
3
670
xarray-Datatree: Hierarchical Data Structures for Multi-Model Science
tomnicholas
0
200
中小企業開発事例から見るサーバーレス
seike460
PRO
4
1.5k
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
49
7.9k
Art Directing for the Web. Five minutes with CSS Template Areas
malarkey
196
9.8k
Git: the NoSQL Database
bkeepers
PRO
418
60k
Principles of Awesome APIs and How to Build Them.
keavy
117
15k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
270
12k
Fontdeck: Realign not Redesign
paulrobertlloyd
74
4.3k
In The Pink: A Labor of Love
frogandcode
132
21k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
236
1.1M
Practical Orchestrator
shlominoach
178
8.9k
Building Adaptive Systems
keathley
27
1.3k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
31
20k
VelocityConf: Rendering Performance Case Studies
addyosmani
317
22k
Transcript
API Design at Andrew Godwin @andrewgodwin
The Problem
Two existing APIs: APIv1 at least 6 years old APIv2
never finished and now too specialised
Outdated: No provision for new features Some interfaces locked down
to old ideas (e.g. payment)
Bad patterns: Same domain as main site /xml/?method=access_code_new Both XML
and JSON as return formats, transformed from each other.
The Task Build a new API for the modern era
SOA Match it as closely as possible
Event service Venue service Order service Payment service SOA Client
Event service Venue service Order service Payment service SOA Client
APIv3 API Client
Future-proof Allow for more features easily
Maintainable Make sure it's easier to extend than start again
The Basis
The Basis Django REST Framework
The Basis Django REST Framework Custom SOA/API coupling
The Basis Django REST Framework Custom SOA/API coupling Piecemeal refactors
of current code
The Basis Django REST Framework Custom SOA/API coupling Piecemeal refactors
of current code APIv1 as initial target to start deprecation
Design Principles
JSON only Mapping XML ←→ JSON rarely works well
REST (ish) Sensible paths, sensible verbs
/events/ /events/39992/ /events/39992/orders/ /events/39992/publish/ /users/me/owned_events/ POST: New event GET: Event
details POST: Update event GET: List of orders /events/39992/orders/12392/ GET: Order details POST: Publish event GET: List of your events DELETE: Delete event
Every response is {} Leaves room for new features/pagination
Pagination everywhere And standardised, so there's no surprises
Introspectable parameters For our documentation and API explorer
None
None
Always more to do Documentation, consistency, and new features
Try it today! http://developer.eventbrite.com
Thanks. @andrewgodwin
[email protected]