SlideShare a Scribd company logo
Engineering Cell
REST
HELLO!
Lucas Bicca
E-mail: lucaslbs15@gmail.com
Twitter: lucaslbs15
JSON API
STANDARDS
{json:api}
“If you'he ever argued with your
team about the way your JSON
responses should be formatted,
JSON API can be your
anti-bikeshedding tool.
{json:api}
WHAT IS BIKESHEDDING PATTERN?
{json:api}
WHAT IS BIKESHEDDING PATTERN?
Some people have commented that the
amount of noise generated by a change is
inversely proportional to the complexity of
the change.
{json:api}
JSON API
CONVENTIONS
Focus on what matters: your application!!!
{json:api}
MUST
MUST NOT
REQUIRED
SHALL
SHALL NOT
JSON API CONVENTIONS
SHOULD
SHOULD NOT
RECOMMENDED
MAY
OPTIONAL
{json:api}
Top Level
A JSON object MUST be at the root of every JSON
API request and response containing data. This
object defines a document's "top level".
{json:api}
JSON API CONVENTIONS
JSON API Standards
JSON API CONVENTIONS
MUST
A document MUST
contain at least one
of the following
top-level members:
data, errors and
meta.
MUST NOT
The members data
and errors MUST
NOT coexist in the
same document.
MAY
A document MAY
contain any of these
top-level members:
jsonapi, links and
included.
{json:api}
JSON API Standards
JSON API Standards
JSON API Standards
JSON API Standards
SHOULD
The page query
parameter is
reserved for
pagination. Servers
and clients SHOULD
use this key for
pagination
operations.
RECOMMENDED
To enable an easy
mapping of member
names to URLs, it is
RECOMMENDED that
member names use
only non-reserved,
URL safe characters
in RFC 3986.
MUST NOT
The server MUST
NOT interpret
missing attributes
as null values.
JSON API CONVENTIONS
{json:api}
CREATING RESOURCES
The request MUST include a single resource
object as primary data. The resource object
MUST contain at least a type member.
{json:api}
JSON API Standards
CREATING RESOURCES -
RESPONSE
The server MUST return a 201 Created status
code if request did not include id.
The response SHOULD include a Location header
identifying the location of the newly created
resource.
JSON API Standards
UPDATING RESOURCES
The PATCH request MUST include a single
resource object as primary data.
The resource object MUST contain type and id
members.
It MUST NOT interpret them as null or empty
values.
{json:api}
JSON API Standards
UPDATING RESOURCES -
RESPONSE
▸ 202 Accepted: if an update request has
been accepted for processing, but the
processing has not been completed by time
the server responds;
▸ 200 OK: if an update is successful, the
client's current attributes remain up to
date. The server MUST NOT include a
representation of the updated resource(s).
DELETING RESOURCES
{json:api}
The server MUST delete the specified members
from the relationship or return a 403 Forbidden
response.
JSON API Standards
DELETING RESOURCES -
RESPONSE
▸ 404 Not Found: a server SHOULD return a
404 Not Found status code if a deletion
request fails due to the resource not
existing;
▸ 204 No Content: a server MUST return a 204
No Content status code if a deletion request
is successful and no content is returned.
CREDITS
▸ JSON API Specifications: http://jsonapi.org/format/
▸ Escaping the Bikeshed with JSON API: https://www.infoq.com/presentations/json-api
▸ The Bikeshed Anti-Pattern: https://wiki.hackerspaces.org/The_Bikeshed_Anti-Pattern
▸ Why Should I Care What Color the Bikeshed Is?: http://bikeshed.org
▸ Pragmatic design with JSON API:
https://jeremiahlee.com/blog/2017/10/10/pragmatic-design-with-json-api/
THANKS!
Questions?

More Related Content

What's hot (20)

PDF
REST full API Design
Christian Guenther
 
PPTX
Salesforce Apex Hours : How Lightning Platform Query Optimizer works for LDV
Amit Chaudhary
 
PDF
A Practical Approach to React Native at All Things Open Conference
Tracy Lee
 
PDF
RxJS: A Beginner & Expert's Perspective - ng-conf 2017
Tracy Lee
 
PPTX
Test driven APIs with Laravel
Michael Peacock
 
PDF
RxJS - The Basics & The Future
Tracy Lee
 
PPTX
RESTful API - Best Practices
Tricode (part of Dept)
 
PDF
GraphQL or RESTful
Juan Victor Minaya León
 
PDF
WordPress RESTful API & Amazon API Gateway (English version)
崇之 清水
 
PDF
Building Smart Home skills for Alexa
AWS Germany
 
KEY
At Begin, URL Handling and REST
Brian Loomis
 
PDF
Building Beautiful REST APIs with ASP.NET Core
Stormpath
 
PDF
Integrate CI/CD Pipelines with Jira Software Cloud
Atlassian
 
PDF
Supercharge Your Pages - New Ways to Extend the Confluence Editor
Atlassian
 
PPTX
Building Social Tools
Anand Hemmige
 
PDF
Why your next serverless project should use AWS AppSync
Yan Cui
 
PPTX
RESTful API Design Fundamentals
Hüseyin BABAL
 
PDF
Designing a beautiful REST json api
0x07de
 
PPTX
Pragmatic REST APIs
amesar0
 
PPTX
Cloud Security Monitoring and Spark Analytics
amesar0
 
REST full API Design
Christian Guenther
 
Salesforce Apex Hours : How Lightning Platform Query Optimizer works for LDV
Amit Chaudhary
 
A Practical Approach to React Native at All Things Open Conference
Tracy Lee
 
RxJS: A Beginner & Expert's Perspective - ng-conf 2017
Tracy Lee
 
Test driven APIs with Laravel
Michael Peacock
 
RxJS - The Basics & The Future
Tracy Lee
 
RESTful API - Best Practices
Tricode (part of Dept)
 
GraphQL or RESTful
Juan Victor Minaya León
 
WordPress RESTful API & Amazon API Gateway (English version)
崇之 清水
 
Building Smart Home skills for Alexa
AWS Germany
 
At Begin, URL Handling and REST
Brian Loomis
 
Building Beautiful REST APIs with ASP.NET Core
Stormpath
 
Integrate CI/CD Pipelines with Jira Software Cloud
Atlassian
 
Supercharge Your Pages - New Ways to Extend the Confluence Editor
Atlassian
 
Building Social Tools
Anand Hemmige
 
Why your next serverless project should use AWS AppSync
Yan Cui
 
RESTful API Design Fundamentals
Hüseyin BABAL
 
Designing a beautiful REST json api
0x07de
 
Pragmatic REST APIs
amesar0
 
Cloud Security Monitoring and Spark Analytics
amesar0
 

Similar to JSON API Standards (20)

PDF
JSON API Specificiation
Wojciech Langiewicz
 
PDF
RESTful HATEOAS standards using Java based Katharsis
Keith Moore
 
PDF
RESTful HATEOAS standards using Java based Katharsis
Keith Moore
 
PPTX
REST Api Tips and Tricks
Maksym Bruner
 
PPTX
Best Practices for Architecting a Pragmatic Web API.
Mario Cardinal
 
PDF
Building sustainable RESTFul services
Ortus Solutions, Corp
 
PDF
the-10-rest-commandments.pdf
DavorKolenc1
 
PPTX
A Deep Dive into RESTful API Design Part 2
VivekKrishna34
 
PDF
RefCard RESTful API Design
OCTO Technology
 
PPTX
Standards of rest api
Maýur Chourasiya
 
PDF
REST more with json-api and fractal
Boyan Yordanov
 
PDF
REST API Basics
Tharindu Weerasinghe
 
PDF
Designing a json/rest api for your mobile app
Olivier Destrebecq
 
PDF
Xamarin Workshop Noob to Master – Week 5
Charlin Agramonte
 
PPTX
REST library.pptx
MSivani
 
PPTX
Restful webservices
Kong King
 
PDF
How to design a good rest api tools, techniques and best practices.
Nuwan Dias
 
PDF
How to design a good REST API: Tools, techniques and best practices
WSO2
 
PDF
PiterPy 2016: Parallelization, Aggregation and Validation of API in Python
Max Klymyshyn
 
JSON API Specificiation
Wojciech Langiewicz
 
RESTful HATEOAS standards using Java based Katharsis
Keith Moore
 
RESTful HATEOAS standards using Java based Katharsis
Keith Moore
 
REST Api Tips and Tricks
Maksym Bruner
 
Best Practices for Architecting a Pragmatic Web API.
Mario Cardinal
 
Building sustainable RESTFul services
Ortus Solutions, Corp
 
the-10-rest-commandments.pdf
DavorKolenc1
 
A Deep Dive into RESTful API Design Part 2
VivekKrishna34
 
RefCard RESTful API Design
OCTO Technology
 
Standards of rest api
Maýur Chourasiya
 
REST more with json-api and fractal
Boyan Yordanov
 
REST API Basics
Tharindu Weerasinghe
 
Designing a json/rest api for your mobile app
Olivier Destrebecq
 
Xamarin Workshop Noob to Master – Week 5
Charlin Agramonte
 
REST library.pptx
MSivani
 
Restful webservices
Kong King
 
How to design a good rest api tools, techniques and best practices.
Nuwan Dias
 
How to design a good REST API: Tools, techniques and best practices
WSO2
 
PiterPy 2016: Parallelization, Aggregation and Validation of API in Python
Max Klymyshyn
 
Ad

Recently uploaded (20)

PDF
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
PPTX
How Apagen Empowered an EPC Company with Engineering ERP Software
SatishKumar2651
 
PPTX
MiniTool Power Data Recovery Full Crack Latest 2025
muhammadgurbazkhan
 
PDF
Powering GIS with FME and VertiGIS - Peak of Data & AI 2025
Safe Software
 
PDF
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
PDF
Efficient, Automated Claims Processing Software for Insurers
Insurance Tech Services
 
PDF
Executive Business Intelligence Dashboards
vandeslie24
 
PDF
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
Nabin Dhakal
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PDF
Salesforce CRM Services.VALiNTRY360
VALiNTRY360
 
PPTX
3uTools Full Crack Free Version Download [Latest] 2025
muhammadgurbazkhan
 
PPTX
A Complete Guide to Salesforce SMS Integrations Build Scalable Messaging With...
360 SMS APP
 
PPTX
Revolutionizing Code Modernization with AI
KrzysztofKkol1
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PDF
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
PDF
Beyond Binaries: Understanding Diversity and Allyship in a Global Workplace -...
Imma Valls Bernaus
 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
PPTX
Engineering the Java Web Application (MVC)
abhishekoza1981
 
PDF
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
PPTX
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
How Apagen Empowered an EPC Company with Engineering ERP Software
SatishKumar2651
 
MiniTool Power Data Recovery Full Crack Latest 2025
muhammadgurbazkhan
 
Powering GIS with FME and VertiGIS - Peak of Data & AI 2025
Safe Software
 
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
Efficient, Automated Claims Processing Software for Insurers
Insurance Tech Services
 
Executive Business Intelligence Dashboards
vandeslie24
 
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
Nabin Dhakal
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
Salesforce CRM Services.VALiNTRY360
VALiNTRY360
 
3uTools Full Crack Free Version Download [Latest] 2025
muhammadgurbazkhan
 
A Complete Guide to Salesforce SMS Integrations Build Scalable Messaging With...
360 SMS APP
 
Revolutionizing Code Modernization with AI
KrzysztofKkol1
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
Beyond Binaries: Understanding Diversity and Allyship in a Global Workplace -...
Imma Valls Bernaus
 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
Engineering the Java Web Application (MVC)
abhishekoza1981
 
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
Ad

JSON API Standards

  • 4. “If you'he ever argued with your team about the way your JSON responses should be formatted, JSON API can be your anti-bikeshedding tool. {json:api}
  • 5. WHAT IS BIKESHEDDING PATTERN? {json:api}
  • 6. WHAT IS BIKESHEDDING PATTERN? Some people have commented that the amount of noise generated by a change is inversely proportional to the complexity of the change. {json:api}
  • 7. JSON API CONVENTIONS Focus on what matters: your application!!! {json:api}
  • 8. MUST MUST NOT REQUIRED SHALL SHALL NOT JSON API CONVENTIONS SHOULD SHOULD NOT RECOMMENDED MAY OPTIONAL {json:api}
  • 9. Top Level A JSON object MUST be at the root of every JSON API request and response containing data. This object defines a document's "top level". {json:api} JSON API CONVENTIONS
  • 11. JSON API CONVENTIONS MUST A document MUST contain at least one of the following top-level members: data, errors and meta. MUST NOT The members data and errors MUST NOT coexist in the same document. MAY A document MAY contain any of these top-level members: jsonapi, links and included. {json:api}
  • 16. SHOULD The page query parameter is reserved for pagination. Servers and clients SHOULD use this key for pagination operations. RECOMMENDED To enable an easy mapping of member names to URLs, it is RECOMMENDED that member names use only non-reserved, URL safe characters in RFC 3986. MUST NOT The server MUST NOT interpret missing attributes as null values. JSON API CONVENTIONS {json:api}
  • 17. CREATING RESOURCES The request MUST include a single resource object as primary data. The resource object MUST contain at least a type member. {json:api}
  • 19. CREATING RESOURCES - RESPONSE The server MUST return a 201 Created status code if request did not include id. The response SHOULD include a Location header identifying the location of the newly created resource.
  • 21. UPDATING RESOURCES The PATCH request MUST include a single resource object as primary data. The resource object MUST contain type and id members. It MUST NOT interpret them as null or empty values. {json:api}
  • 23. UPDATING RESOURCES - RESPONSE ▸ 202 Accepted: if an update request has been accepted for processing, but the processing has not been completed by time the server responds; ▸ 200 OK: if an update is successful, the client's current attributes remain up to date. The server MUST NOT include a representation of the updated resource(s).
  • 24. DELETING RESOURCES {json:api} The server MUST delete the specified members from the relationship or return a 403 Forbidden response.
  • 26. DELETING RESOURCES - RESPONSE ▸ 404 Not Found: a server SHOULD return a 404 Not Found status code if a deletion request fails due to the resource not existing; ▸ 204 No Content: a server MUST return a 204 No Content status code if a deletion request is successful and no content is returned.
  • 27. CREDITS ▸ JSON API Specifications: http://jsonapi.org/format/ ▸ Escaping the Bikeshed with JSON API: https://www.infoq.com/presentations/json-api ▸ The Bikeshed Anti-Pattern: https://wiki.hackerspaces.org/The_Bikeshed_Anti-Pattern ▸ Why Should I Care What Color the Bikeshed Is?: http://bikeshed.org ▸ Pragmatic design with JSON API: https://jeremiahlee.com/blog/2017/10/10/pragmatic-design-with-json-api/