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
270
Django Through The Years
andrewgodwin
0
170
Writing Maintainable Software At Scale
andrewgodwin
0
400
A Newcomer's Guide To Airflow's Architecture
andrewgodwin
0
320
Async, Python, and the Future
andrewgodwin
2
620
How To Break Django: With Async
andrewgodwin
1
680
Taking Django's ORM Async
andrewgodwin
0
680
The Long Road To Asynchrony
andrewgodwin
0
600
The Scientist & The Engineer
andrewgodwin
1
710
Other Decks in Programming
See All in Programming
Kanzawa.rbのLT大会を支える技術の裏側を変更する Ruby on Rails + Litestream 編
muryoimpl
0
170
Open source software: how to live long and go far
gaelvaroquaux
0
520
Terraform で作る Amazon ECS の CI/CD パイプライン
hiyanger
0
130
AIの力でお手軽Chrome拡張機能作り
taiseiue
0
150
Kubernetes History Inspector(KHI)を触ってみた
bells17
0
170
知られざるDMMデータエンジニアの生態 〜かつてツチノコと呼ばれし者〜
takaha4k
3
1.1k
functionalなアプローチで動的要素を排除する
ryopeko
1
1.2k
バックエンドのためのアプリ内課金入門 (サブスク編)
qnighy
8
1.7k
Pythonでもちょっとリッチな見た目のアプリを設計してみる
ueponx
1
330
[Fin-JAWS 第38回 ~re:Invent 2024 金融re:Cap~]FaultInjectionServiceアップデート@pre:Invent2024
shintaro_fukatsu
0
390
SwiftUIで単方向アーキテクチャを導入して得られた成果
takuyaosawa
0
230
JavaScriptツール群「UnJS」を5分で一気に駆け巡る!
k1tikurisu
10
1.7k
Featured
See All Featured
Done Done
chrislema
182
16k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
How to train your dragon (web standard)
notwaldorf
90
5.8k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.1k
Being A Developer After 40
akosma
89
590k
Designing for Performance
lara
604
68k
How to Ace a Technical Interview
jacobian
276
23k
Become a Pro
speakerdeck
PRO
26
5.1k
Making the Leap to Tech Lead
cromwellryan
133
9.1k
GraphQLとの向き合い方2022年版
quramy
44
13k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7k
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]