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
Desigining the new GoCardless API
Search
Harry Marr
August 13, 2014
Technology
3
170
Desigining the new GoCardless API
Harry Marr
August 13, 2014
Tweet
Share
More Decks by Harry Marr
See All by Harry Marr
Build your own Heroku
hmarr
1
120
CodeCube: Runnable Gists
hmarr
1
190
Other Decks in Technology
See All in Technology
自社 200 記事を元に整理した読みやすいテックブログを書くための Tips 集
masakihirose
2
370
TSのコードをRustで書き直した話
askua
4
640
Mocking your codebase without cursing it
gaqzi
0
110
メンバーがオーナーシップを発揮しやすいチームづくり
ham0215
2
300
When Windows Meets Kubernetes…
pichuang
0
320
商品レコメンドでのexplicit negative feedbackの活用
alpicola
2
470
Docker Desktop で Docker を始めよう
zembutsu
PRO
1
210
2025年のARグラスの潮流
kotauchisunsun
0
870
WantedlyでのKotlin Multiplatformの導入と課題 / Kotlin Multiplatform Implementation and Challenges at Wantedly
kubode
0
260
スクラムマスターの活動と組織からの期待のズレへの対応 / Dealing with the gap between Scrum Master activities and organizational expectations
pauli
1
620
メールヘッダーを見てみよう
hinono
0
140
JAWS-UG20250116_iOSアプリエンジニアがAWSreInventに行ってきた(真面目編)
totokit4
0
170
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
137
6.7k
Gamification - CAS2011
davidbonilla
80
5.1k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
49
2.2k
How GitHub (no longer) Works
holman
312
140k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
4
190
Facilitating Awesome Meetings
lara
51
6.2k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
3
360
Music & Morning Musume
bryan
46
6.3k
Mobile First: as difficult as doing things right
swwweet
222
9k
Building Better People: How to give real-time feedback that sticks.
wjessup
366
19k
Being A Developer After 40
akosma
89
590k
Transcript
Designing the new GoCardless API Harry Marr and Philip Harrison
None
GrouPAY API
GrAPI
None
1. Agile API development 2. Build your framework 3. Prepare
for change
HOW TO BUILD PRODUCTS
None
None
None
None
Work out what people want Build it
Work out what people want Build it Work out what
people really want
Work out what people want Build it Work out what
people really want
HOW TO BUILD APIS
Work out what people want Build it
Work out what people want Build it Work out what
people really want
Work out what people want Build it Work out what
people really want Uh oh!
Changing a product is easy Changing your API is hard
1. Agile API development 2. Build your framework 3. Prepare
for change
MAKING IT LAST
• Content Type • Document/url structure • TLS/SSL • Pagination
• Rate-limiting • Errors
CONTENT TYPE
{ "payment": { "xmlns": "urn:ns:payment", "amount": { "$t": 20000 },
"metadata": { "type": "metadata", "xmlns": "urn:ns:metadata", "description": { "$t": "Rent" } } } }
{ "payment": { "amount": 20000, "metadata": { "description": "Rent" }
} } https://www.mnot.net/blog/2012/04/13/json_or_xml_just_decide
DOCUMENT/URL STRUCTURE
{ "linked": { "author": { "id": "12" } }, "posts":
[{ "id": "1", "title": "API", "links": { "author": "12" } }] } http://jsonapi.org/format/
/customers/1/bank_accounts/2/mandates/1 Don’t map database relations to urls
/mandates?bank_account=2 /customer_bank_accounts?customer=1 Flexible relationships
TLS/SSL All traffic including web hooks https://istlsfastyet.com/
PAGINATION
/payments { "meta": { "cursors": { "after": "abcd1234", "before": "wxyz0987"
}, "limit": 50 }, "payments": [{ ... }] } /payments?limit=50&after=abcd1234
RATE-LIMITING
X-Rate-Limit-Limit: 5000 X-Rate-Limit-Remaining: 0 X-Rate-Limit-Reset: Thu, 01 May 2014 16:00:00
GMT Content-Type: application/json; charset=utf-8 Connection: keep-alive Retry-After: Thu, 01 May 2014 16:00:00 GMT
ERRORS
{ "error": { "documentation_url": “https://errors", "id": “ERROR_ID”, "type": "validation_failed”, "code":
422, "errors": [{ "field": "account_number", "type": "missing_field", "message": "is required" }] } }
GoCardless API design https://github.com/gocardless/http-api-design
1. Agile API development 2. Build your framework 3. Prepare
for change
Work out what people want Build it Work out what
people really want Uh oh!
Work out what people want Build it Work out what
people really want
✓ Adding resources ✓ Adding attributes ✗ Removing attributes ✗
Changing attributes ✗ Removing resources ✗ Changing behaviour
/v1
/v1
v1
2014-08-13
/2014-08-13
2014-08-13
You are currently using version 2014-‐05-‐12. ! Click here
to view all changes since 2014-‐05-‐12. To:
[email protected]
From:
[email protected]
GoCardless API Update Available
In summary, • Developing an API is hard • Think
about what you can’t change • And plan for incremental updates
QUESTIONS? ! @harrymarr @harrisonphilip