Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Building a Better API with JSON:API
Search
Chris Guzman
August 20, 2017
Technology
75
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
CloudWatch Logsのコスト最適化:どこまでAIに任せてどこから人間が承認すべきか
yama3133
0
150
AI導入は済んだ。次は統制を作り替える番だ_AI×開発組織 Summit 2026
techtekt
PRO
0
480
Browser Spec: Testing Hotwire with Ruby
takahashim
1
150
S3 Filesで挑む! 八戸せんべい汁の食べ頃問題
usanchuu
0
140
CSS2026:OWS研究会・招待講演「世界観を、実装する」
atsush1_sada
2
130
その Valkey 使いこなしていますか?
onk
PRO
5
1.8k
日本語に強いオープンな大規模言語モデル「LLM-jp」
odashi
5
1.2k
[JAWS-UG彩の国埼玉#12]そろそろ準備する?re:Invent2026をやさしく解説 / reinvent2026-sainokuni
sh_fk2
1
380
Persisting Massive Data with Rails ~Designing for 60 billion rows, and fighting the bottlenecks~ Railsで挑む大量データ永続化 〜600億件を永続化するための設計とボトルネックとの戦い〜
occhi
0
770
トークン化預金DCJPYの取り組みと活用ユースケース
finengine
0
210
freeeにおける AI を用いた ブラウザ動作確認の自動化の取り組み
freee
PRO
0
110
Codex を使った障害対応机上演習の実際
orgachem
PRO
0
230
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
96
14k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.7k
Statistics for Hackers
jakevdp
799
230k
So, you think you're a good person
axbom
PRO
2
2.2k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.9k
Code Review Best Practice
trishagee
74
20k
Chasing Engaging Ingredients in Design
codingconduct
0
370
The agentic SEO stack - context over prompts
schlessera
0
970
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
490
Fantastic passwords and where to find them - at NoRuKo
philnash
53
4k
GraphQLとの向き合い方2022年版
quramy
50
15k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
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