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
Battle tested API design - Laracon EU Online
Search
Johannes Pichler
May 20, 2020
Programming
0
74
Battle tested API design - Laracon EU Online
Johannes Pichler
May 20, 2020
Tweet
Share
More Decks by Johannes Pichler
See All by Johannes Pichler
Crafting Elegant APIs with Laravel
fetzi
0
75
Battle tested API Design - Laravel Edition (PHP.RUHR)
fetzi
0
65
Battle tested API design
fetzi
0
78
Mastering CLIs
fetzi
0
41
(Understanding) OAuth2
fetzi
0
210
Decouple Everything
fetzi
0
200
Go Basics Workshop
fetzi
1
62
Getting more out of Git (german)
fetzi
0
57
Go for PHP devs
fetzi
3
100
Other Decks in Programming
See All in Programming
shadcn/uiを使ってReactでの開発を加速させよう!
lef237
0
280
Запуск 1С:УХ в крупном энтерпрайзе: мечта и реальность ПМа
lamodatech
0
920
range over funcの使い道と非同期N+1リゾルバーの夢 / about a range over func
mackee
0
220
PHPカンファレンス 2024|共創を加速するための若手の技術挑戦
weddingpark
0
120
return文におけるstd::moveについて
onihusube
1
1.4k
責務を分離するための例外設計 - PHPカンファレンス 2024
kajitack
9
2.3k
QA環境で誰でも自由自在に現在時刻を操って検証できるようにした話
kalibora
1
130
各クラウドサービスにおける.NETの対応と見解
ymd65536
0
240
HTML/CSS超絶浅い説明
yuki0329
0
180
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
230
Fixstars高速化コンテスト2024準優勝解法
eijirou
0
180
선언형 UI에서의 상태관리
l2hyunwoo
0
260
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
137
6.7k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
29
950
Optimizing for Happiness
mojombo
376
70k
Building an army of robots
kneath
302
44k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.3k
Practical Orchestrator
shlominoach
186
10k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.9k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
Designing for humans not robots
tammielis
250
25k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
A designer walks into a library…
pauljervisheath
205
24k
Transcript
Ba#le tested API design Laracon EU Online 2020
Johannes Pichler • Web Developer since 2006 • PHP, .NET,
Java • working @ karriere.at
Agenda • API design • Implemen/ng an API in Laravel
None
API Design
Steps for building your API Design • Requirements & Planning
• Implementa4on • Verifica4on & Maintenance
Requirements & Planning
Consider the client(s)
Rou$ng • based on resources • use standard HTTP methods
• be as explicit as possible
Rou$ng GET: /todos GET: /todos/{id} POST: /todos PUT: /todos/{id} DELETE:
/todos/{id}
Rou$ng - API Versioning • frequency of endpoint changes •
handling of breaking changes • use seman8c versioning • use only major version in URLs
Response format • no custom response format • use a
defined standard • JSON:API • HAL
Authoriza*on • use specific client tokens • add access tokens
for sensi3ve endpoints
API Specifica,on • use an API client like Stoplight Studio
or Postman • define your endpoints with edge cases • make your specifica;on testable
Implemen'ng an API in Laravel
Verifica(on & Maintenance
Verifica(on • it's all about metrics • have useful error
logging in place • verify your assump7ons during development
Maintenance • be careful with breaking changes • s3ck to
seman3c versioning • keep your API specifica3on up to date
Summary
Resources • h#ps:/ /github.com/fetzi/laracon-api-design • h#ps:/ /jsonapi.org/
THANKS @fetzi_io