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
Running a Public API Do's and Don'ts
Search
Sibiu Web Meetup
October 18, 2019
Programming
0
60
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
Git commit messages and PR etiquette
sibiuwebmeetup
0
16
Introduction to Cypress
sibiuwebmeetup
0
13
Web Application Security
sibiuwebmeetup
0
69
Zero Coupled Microservices
sibiuwebmeetup
0
8
Ethereum: Quick & Dirty
sibiuwebmeetup
0
75
Automation in Code Reviews
sibiuwebmeetup
0
96
useState(props.title)
sibiuwebmeetup
0
82
Introduction into ClojureScript
sibiuwebmeetup
0
34
Launching into Orbit.js
sibiuwebmeetup
0
42
Other Decks in Programming
See All in Programming
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
1
290
「今のプロジェクトいろいろ大変なんですよ、app/services とかもあって……」/After Kaigi on Rails 2024 LT Night
junk0612
5
2.1k
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
RubyLSPのマルチバイト文字対応
notfounds
0
120
弊社の「意識チョット低いアーキテクチャ」10選
texmeijin
5
24k
Realtime API 入門
riofujimon
0
150
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.1k
受け取る人から提供する人になるということ
little_rubyist
0
230
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1k
Amazon Bedrock Agentsを用いてアプリ開発してみた!
har1101
0
330
subpath importsで始めるモック生活
10tera
0
300
OnlineTestConf: Test Automation Friend or Foe
maaretp
0
100
Featured
See All Featured
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
410
Agile that works and the tools we love
rasmusluckow
327
21k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.2k
Writing Fast Ruby
sferik
627
61k
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
The Pragmatic Product Professional
lauravandoore
31
6.3k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Music & Morning Musume
bryan
46
6.2k
Practical Orchestrator
shlominoach
186
10k
How STYLIGHT went responsive
nonsquared
95
5.2k
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