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
Building a Better API with JSON:API
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Chris Guzman
August 20, 2017
Technology
50
0
Share
Building a Better API with JSON:API
Chris Guzman
August 20, 2017
More Decks by Chris Guzman
See All by Chris Guzman
Android libraries I wish I knew when I started
chrisguzman
21
55k
Other Decks in Technology
See All in Technology
職能の壁を取り払った先で見えた壁 -AI時代のクロスファンクショナル組織-
shimotaroo
1
110
ARIA Notifyについて
ryokatsuse
1
120
AWS DevOps Agentはチームメイトになれるのか?/ Can AWS DevOps Agent become a teammate
kinunori
6
660
終盤で崩壊させないAI駆動開発
j5ik2o
2
2.2k
マルチエージェント × ハーネスエンジニアリング × GitLab Duo Agent Platformで実現する「AIエージェントに仕事をさせる時代へ。」 / 20260421 GitLab Duo Agent Platform
n11sh1
0
130
Rapid Start: Faster Internet Connections, with Ruby's Help
kazuho
2
150
CloudSec JP #005 後締め ~ソフトウェアサプライチェーン攻撃から開発者のシークレットを守る~
lhazy
0
220
研究開発部メンバーの働き⽅ / Sansan R&D Profile
sansan33
PRO
4
23k
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.4k
最初の一歩を踏み出せなかった私が、誰かの背中を押したいと思うようになるまで / give someone a push
mii3king
0
150
AIペネトレーションテスト・ セキュリティ検証「AgenticSec」ご紹介資料
laysakura
0
3.8k
Code Interpreter で、AIに安全に コードを書かせる。
yokomachi
0
6.9k
Featured
See All Featured
We Have a Design System, Now What?
morganepeng
55
8.1k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
160
Between Models and Reality
mayunak
3
260
Navigating Team Friction
lara
192
16k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
290
Are puppies a ranking factor?
jonoalderson
1
3.3k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
61
43k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
170
Visualization
eitanlees
150
17k
Balancing Empowerment & Direction
lara
6
1k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
180
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
740
Transcript
{json:api} A specification for building APIs in JSON
{json:api} A specification for building APIs in JSON duh
None
None
{json:api}
{json:api}
{"json":"api"}
Why?
None
» Minimize requests & data between clients & servers »
Consistency, popular among consultancies » Always backwards compatible » Stable 1.0, not dead
No really
History
!+"+#$+%=
None
Spec
» data: the document’s “primary data” » errors: an array
of error objects » meta: a meta object that contains non-standard meta- information.
Data
{ "data": { "type": "articles", "id": "1", "attributes": { "title":
"Rails is Omakase" }, "relationships": { }, "links": { "self": "http://example.com/articles/1" }, } }
Relationships
{ "relationships": { "author": { "links": { "self": "/articles/1/relationships/author", "related":
"/articles/1/author" }, "data": { "type": "people", "id": "9" } } } }
Meta
{ "meta": { "count": "42", "copyright": "Copyright 2015 Example Corp.",
"authors": [ "Yehuda Katz", "Steve Klabnik", "Dan Gebhardt", "Tyler Kellen" ] } }
Errors
{ "errors": [ "id": "UUID", "status": "418", "code": "42", "title":
"You're a teapot", "detail": "The object is not short nor stout", "links": { "about": "https://httpstatuses.com/418" }, "meta": { "email": "
[email protected]
" } ] }
GET /articles Accept: application/vnd.api+json GET /articles/1 Accept: application/vnd.api+json GET /articles/1/author
Accept: application/vnd.api+json
#Request comments with an article GET /articles/1?include=comments Accept: application/vnd.api+json #Request
comments as well as the author of each of those comments GET /articles/1?include=comments.author Accept: application/vnd.api+json
GET /articles?include=comments,author &fields[people]=first-name,last-name &sort=-date » fetch all articles with their
associated comments and authors » Only be return the first and last names » Sorted by date, most recent first
POST /photos { "data": { "type": "photos", "attributes": { "title":
"Ember Hamster", "src": "http://example.com/images/productivity.png" }, "relationships": { "photographer": { "data": { "type": "people", "id": "9" } } } } }
None
None
None