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
A Newcomer's Guide To Airflow's Architecture
andrewgodwin
0
99
Async, Python, and the Future
andrewgodwin
1
380
How To Break Django: With Async
andrewgodwin
1
310
Taking Django's ORM Async
andrewgodwin
0
340
The Long Road To Asynchrony
andrewgodwin
0
390
The Scientist & The Engineer
andrewgodwin
1
380
Pioneering Real-Time
andrewgodwin
0
150
Just Add Await: Retrofitting Async Into Django
andrewgodwin
2
1.1k
Terrain, Art, Python and LiDAR
andrewgodwin
1
240
Other Decks in Programming
See All in Programming
I/O Extended 2022 in Android ~ Whats new in Android development tools
pluu
0
560
"What's new in Swift"の要約 / swift_5_7_summary
uhooi
1
330
Meet Swift Regex
usamik26
0
350
即、New Relic / New Relic NOW!
uzulla
0
330
iOS 16からのロック画面Widget争奪戦に備える
tsuzuki817
0
230
Reactive Java Microservices on Kubernetes with Spring and JHipster
deepu105
1
170
1時間半で克服するJavaScriptの非同期処理/async_javascript_kokufuku
marchin1989
2
620
Gitlab CIでMRを自動生成する
forcia_dev_pr
0
120
Modern Android Developer ~ 안내서
pluu
1
640
Vite でお手軽 Vue.js の環境構築
azuki
2
180
IE Graduation (IE の功績を讃える)
jxck
20
12k
Get Ready for Jakarta EE 10
ivargrimstad
0
2.4k
Featured
See All Featured
4 Signs Your Business is Dying
shpigford
169
20k
The Invisible Customer
myddelton
110
11k
The Art of Programming - Codeland 2020
erikaheidi
32
11k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
351
21k
Imperfection Machines: The Place of Print at Facebook
scottboms
253
12k
Why You Should Never Use an ORM
jnunemaker
PRO
47
7.6k
5 minutes of I Can Smell Your CMS
philhawksworth
196
18k
10 Git Anti Patterns You Should be Aware of
lemiorhan
638
52k
Producing Creativity
orderedlist
PRO
334
37k
Building a Scalable Design System with Sketch
lauravandoore
448
30k
For a Future-Friendly Web
brad_frost
166
7.4k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
37
3.3k
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 andrewgodwin@eventbrite.com