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
160
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
110
CodeCube: Runnable Gists
hmarr
1
180
Other Decks in Technology
See All in Technology
生成AI活用推進の為にやったこと/やらなかったこと
ktc_wada
0
160
QAエンジニアが伝えたい品質保証の羅針盤 / Compass for Quality Assurance
mii3king
1
330
B2C、B2B プロダクトマネジメントの違い(および思考の罠) / B2C, B2B PM and reduction fallacy
ykmc09
5
2.3k
TypeScript の抽象構文木を用いた、数百を超える API の大規模リファクタリング戦略
yanaemon
6
1.2k
Blazor WASM × Code-first gRPC で始める C# ⼤統⼀理論
sansantech
PRO
1
460
技術力の伸ばし方を考える
khirata
0
140
本当のガバクラ基礎
toru_kubota
0
320
Prisma ORMを2年運用して培ったノウハウを共有する
tockn
19
5k
Databricksの生成AI戦略
taka_aki
1
370
20240509 CloudWatch でいろいろなものを監視してみよう
masaruogura
1
120
Autonomous Database Cloud 技術詳細 / adb-s_technical_detail_jp
oracle4engineer
PRO
15
36k
汎用ポリシー言語Rego + OPAと認可・検証事例の紹介 / Introduction Rego & OPA for authorization and validation
mizutani
1
150
Featured
See All Featured
Clear Off the Table
cherdarchuk
86
310k
From Idea to $5000 a Month in 5 Months
shpigford
377
45k
Adopting Sorbet at Scale
ufuk
69
8.6k
The MySQL Ecosystem @ GitHub 2015
samlambert
244
12k
Practical Orchestrator
shlominoach
183
9.8k
Building Better People: How to give real-time feedback that sticks.
wjessup
356
18k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
352
28k
Done Done
chrislema
178
15k
Fontdeck: Realign not Redesign
paulrobertlloyd
76
4.9k
Atom: Resistance is Futile
akmur
260
25k
[RailsConf 2023] Rails as a piece of cake
palkan
28
4.1k
Raft: Consensus for Rubyists
vanstee
133
6.3k
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