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
70
Battle tested API Design - Laravel Edition (PHP.RUHR)
fetzi
0
63
Battle tested API design
fetzi
0
78
Mastering CLIs
fetzi
0
38
(Understanding) OAuth2
fetzi
0
200
Decouple Everything
fetzi
0
200
Go Basics Workshop
fetzi
1
61
Getting more out of Git (german)
fetzi
0
57
Go for PHP devs
fetzi
3
100
Other Decks in Programming
See All in Programming
Semantic Kernelのネイティブプラグインで知識拡張をしてみる
tomokusaba
0
170
htmxって知っていますか?次世代のHTML
hiro_ghap1
0
260
ゆるやかにgolangci-lintのルールを強くする / Kyoto.go #56
utgwkk
1
290
14 Years of iOS: Lessons and Key Points
seyfoyun
1
760
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
230
CSC509 Lecture 14
javiergs
PRO
0
130
開発者とQAの越境で自動テストが増える開発プロセスを実現する
92thunder
1
160
CSC305 Lecture 26
javiergs
PRO
0
130
[JAWS-UG横浜 #76] イケてるアップデートを宇宙いち早く紹介するよ!
maroon1st
0
430
Thoughts and experiences on Rust and TypeScript
unvalley
2
220
Cursorでアプリケーションの追加開発や保守をどこまでできるか試したら得るものが多かった話
drumnistnakano
0
310
N.E.X.T LEVEL
pluu
2
290
Featured
See All Featured
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
The Language of Interfaces
destraynor
154
24k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Being A Developer After 40
akosma
87
590k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
What's in a price? How to price your products and services
michaelherold
243
12k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
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