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
API Design at Eventbrite
Search
Andrew Godwin
April 10, 2014
Programming
2
2.6k
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
Reconciling Everything
andrewgodwin
1
260
Django Through The Years
andrewgodwin
0
160
Writing Maintainable Software At Scale
andrewgodwin
0
400
A Newcomer's Guide To Airflow's Architecture
andrewgodwin
0
310
Async, Python, and the Future
andrewgodwin
2
610
How To Break Django: With Async
andrewgodwin
1
670
Taking Django's ORM Async
andrewgodwin
0
680
The Long Road To Asynchrony
andrewgodwin
0
590
The Scientist & The Engineer
andrewgodwin
1
700
Other Decks in Programming
See All in Programming
『改訂新版 良いコード/悪いコードで学ぶ設計入門』活用方法−爆速でスキルアップする!効果的な学習アプローチ / effective-learning-of-good-code
minodriven
28
3.9k
PSR-15 はあなたのための ものではない? - phpcon2024
myamagishi
0
400
KubeCon NA 2024の全DB関連セッションを紹介
nnaka2992
0
120
Внедряем бюджетирование, или Как сделать хорошо?
lamodatech
0
930
AHC041解説
terryu16
0
320
Stackless и stackful? Корутины и асинхронность в Go
lamodatech
0
1.3k
為你自己學 Python
eddie
0
510
LLM Supervised Fine-tuningの理論と実践
datanalyticslabo
8
1.9k
Alba: Why, How and What's So Interesting
okuramasafumi
0
200
Simple組み合わせ村から大都会Railsにやってきた俺は / Coming to Rails from the Simple
moznion
3
2.1k
Swiftコンパイラ超入門+async関数の仕組み
shiz
0
170
Fixstars高速化コンテスト2024準優勝解法
eijirou
0
190
Featured
See All Featured
Done Done
chrislema
182
16k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
Agile that works and the tools we love
rasmusluckow
328
21k
Docker and Python
trallard
43
3.2k
The Invisible Side of Design
smashingmag
299
50k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.1k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Practical Orchestrator
shlominoach
186
10k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.4k
Measuring & Analyzing Core Web Vitals
bluesmoon
5
200
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.5k
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]