Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Running a Public API Do's and Don'ts
Sibiu Web Meetup
October 18, 2019
Programming
0
43
Running a Public API Do's and Don'ts
Sibiu Web Meetup
October 18, 2019
Tweet
Share
More Decks by Sibiu Web Meetup
See All by Sibiu Web Meetup
Ethereum: Quick & Dirty
sibiuwebmeetup
0
15
Automation in Code Reviews
sibiuwebmeetup
0
26
useState(props.title)
sibiuwebmeetup
0
68
Introduction into ClojureScript
sibiuwebmeetup
0
13
Launching into Orbit.js
sibiuwebmeetup
0
27
Static website generators
sibiuwebmeetup
0
17
Static website generators in PHP
sibiuwebmeetup
0
17
Concurrency in Ember
sibiuwebmeetup
0
38
Mobile JavaScript Development
sibiuwebmeetup
1
66
Other Decks in Programming
See All in Programming
SRE NEXT 2022に学ぶこれからのSREキャリア
fukubaka0825
2
390
atama plusの開発チームはどのように「不確実性」に向き合ってきたか〜2022夏版〜
atamaplus
3
610
More Than Micro Frontends: 3 Further Use Cases for Module Federation @DWX 2022
manfredsteyer
PRO
0
360
Pythonによる開発をアップデートするライブラリの紹介
daikikatsuragawa
1
600
Recap CDN, Edge, WebAssembly | ワインと鍋.js#1
sadnessojisan
2
1.2k
Rector, time to refactor your code easily
guikingone
2
150
Better Angular Architectures: Architectures with Standalone Components @DWX2022
manfredsteyer
PRO
1
390
フロントエンドエンジニアが変える現場のモデリング意識/modeling-awareness-changed-by-front-end-engineers
uggds
32
13k
ESM移行は無理だけどおれもSindreのライブラリが使いたい!
sosukesuzuki
2
540
Rust、何もわからない...#3
estie
0
150
Windows コンテナ Dojo 第5回 OpenShift で学ぶ Kubernetes 入門
oniak3ibm
PRO
0
130
Amazon SageMakerでImagenを動かして猫画像生成してみた
hotoke_neko
0
110
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
11
1.6k
Navigating Team Friction
lara
175
11k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
151
13k
10 Git Anti Patterns You Should be Aware of
lemiorhan
638
52k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
349
27k
Facilitating Awesome Meetings
lara
29
4.1k
Streamline your AJAX requests with AmplifyJS and jQuery
dougneiner
127
8.5k
Keith and Marios Guide to Fast Websites
keithpitt
404
21k
Automating Front-end Workflow
addyosmani
1351
200k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
316
19k
Become a Pro
speakerdeck
PRO
3
900
A better future with KSS
kneath
226
16k
Transcript
Running a Public API Running a Public API Do's and
Don'ts Do's and Don'ts Sibiu Web Meetup #7 - Oct 18, 2019 Jakob Cosoroabă
Jakob Jakob Cosoroabă Cosoroabă Full Stack Developer Product Developer VP
of "git blame" Tsar of "wait what?" the smarter platform for legal intelligence
Sibiu Web Meetup #1 - Nov 23, 2018
Consumer Consumer OH so Many Government APIs Producer Producer 1M/day
request Legal Data
What this talk is NOT about What this talk is
NOT about SOAP vs REST vs GraphQL JSON vs XML vs GRPC JsonAPI vs WDSL
The Basics The Basics
What is a public API What is a public API
used by 3rd parties public documentation
Read-only APIs? Read-only APIs? J JA AMStack MStack
HTTPS HTTPS
Avoid NIHS Avoid NIHS Not Invented Here Syndrome Not Invented
Here Syndrome use api gateways/proxy instead of coding yourself all the basic stuff
- Pablo Ruiz Picasso Jakob NOW-
Must Do Must Do
design first design first
free thinking free thinking API endpoints don't have to follow
API endpoints don't have to follow internal structure internal structure
Versioning Versioning /v1 x-api-version=2019-10-22
Valid Documentation Valid Documentation
Errors Errors
Sane Formats Sane Formats (tweet since removed) (tweet since removed)
Error 007 Error 007
Use the Right Status Use the Right Status
HTTP Response HTTP Response Headers Headers
x-request-id x-request-id
X-RateLimit-Remaining X-RateLimit-Remaining https://stackoverflow.com/questions/1602 2624/examples-of-http-api-rate-limiting- http-response-headers
Retry-After Retry-After https://tools.ietf.org/html/rfc7231#section- 7.1.3
x-credits-left x-credits-left
Cteonnt-Length Cteonnt-Length https://twitframe.com/show? url=https://twitter.com/jcsrb/status/11593896 37066051585
Don't Don't
do not use a browser do not use a browser
for testing too much for testing too much magic magic ♂ ♂ ♂ ♂ ♂ ♂ https://www.ietf.org/rfc/rfc3986.txt
products/1 products/1 products/2 products/2 products/3 products/3
POST /email/deliver POST /email/deliver
Should Do Should Do
Idempotence Idempotence
Actor Tracking Actor Tracking
Offer ASYNC Offer ASYNC
Sandbox Sandbox
Security Security
CORS CORS Signed Webhooks Signed Webhooks Known Origin Known Origin
Nice to have Nice to have
Dashboard Dashboard Multi WebHook Multi WebHook Status Page Status Page
NEVER NEVER
Remove Fields Remove Fields
DELETE with Params DELETE with Params
PUNCHCARDS PUNCHCARDS
Our API Business hours are from 9 - 12, Our
API Business hours are from 9 - 12, 13-17 Monday to Friday except Public 13-17 Monday to Friday except Public holidays holidays
Tools Tools
API Testing API Testing curl insomnia postman API Proxy API
Proxy Kong Tyk.io Express Gateway AWS/Azure Gateway
API Definitions API Definitions RAML API Blueprint (apiary) OpenAPI Specification
API Starter Kits API Starter Kits Node Laravel Rails https://github.com/feredean/node-api-starter https://github.com/joselfonseca/laravel-api https://guides.rubyonrails.org/api_app.html
Thanks Thanks and don't build don't build