SlideShare a Scribd company logo
How HATEOAS
changes the way to
build and test the APIs
Sam ROTTENBERG
API Days, Paris, 30th January 2018
2//
Hate oh what?
3//
HATEOAS
Hypermedia As the Engine Of Application State
“REST is defined by four interface constraints:
- identification of resources;
- manipulation of resources through representations;
- Selfdescriptive messages;
- and, hypermedia as the engine of application state.”
[Fielding 2000]
4//
Example of web
application
5//
Example of web application
PAAS Web Application
- List apps
- App details page
- App management operations
- Start / Stop
- Delete
- ...
6//
Levels of REST
Richardson
Maturity Model
7//
Levels of REST / Richardson Maturity Model
Level 0
- HTTP as the communication protocol
- Service↔URI
- Call semantics contained in custom messages
- POST requests
- Always 200 status code (even for errors)
- SOAP-like (without envelope)
8//
Levels of REST / Richardson Maturity Model
Level 0 - Example
- POST /appService
- Request body
- <startAppRequest>...</startAppRequest>
- Response body (status code 200)
- <startAppResponse>...</startAppResponse>
- <startAppError>...</startAppError>
9//
Levels of REST / Richardson Maturity Model
Level 1
- Resources
- Resource↔URI
- Calling “methods” on resources (object oriented style)
- Call semantics (cf. level 0)
10//
Levels of REST / Richardson Maturity Model
Level 1 - Example
- POST /apps/my-app
- Request body
- <startAppRequest>...</startAppRequest>
- Response body (status code 200)
- <startAppResponse>...</startAppResponse>
- <startAppError>...</startAppError>
11//
Levels of REST / Richardson Maturity Model
Level 2
- HTTP Verbs + HTTP Response codes
- Resource↔URI
- Function↔Verb + URI
- Comply with HTTP verbs and response codes semantics
- GET : safe, does not change state
- POST/PUT/DELETE : changes state
- 200, 201, 401, 402, etc.
12//
Levels of REST / Richardson Maturity Model
Level 2 - Example
- GET /apps/my-app
- 200 Ok with app details in body
- PUT /apps/my-app
- 204 No Content
- DELETE /apps/my-app
- 204 No Content
- POST /apps
- 201 Created
13//
Levels of REST / Richardson Maturity Model
Level 3
- Enriched resources representations in responses with
hypermedia controls
- Links to resources or actions related to the current
resource
- Forms
- Datatype information (links to schemas)
- ...
14//
Levels of REST / Richardson Maturity Model
Level 3 - Example
<app id=”my-app”>
<link rel=”stop” uri=”/apps/my-app/stop” />
...
</app>
15//
Immediate
advantage of
HATEOAS
16//
Immediate advantage of HATEOAS
Server knows best
- Business rules
- Actions depending on access rights
- Actions depending on resource state
- Level 2 and below
- Duplicated rules client-side
- Level 3 - HATEOAS
- Navigation based on server’s response
17//
Going further with
HATEOAS
18//
Going further with HATEOAS
I have a dream
- Auto-generated static and dynamic API documentation
- Scaffolding based on the API documentation
- API demo
- Testing
- Adding semantics (with shared ontologies)
- Auto-discovery of services
- Client-side development becomes building UI kits for
pre-defined semantics
19//
So why isn’t
HATEOAS
everywhere?!
20//
HATEOAS Challenges
The dark side of the moon
- Building HATEOAS API is very difficult
- Frameworks are function-oriented and not
resource-oriented
- Too much workload to maintain documentation by
hand
- Various formats (HAL, JSON-LD, Hydra, etc.), no
standard
- Need specific tools/framework
21//
HATEOAS needs
your help!
22//
Thanks!
Questions?

More Related Content

Similar to APIDays 2018 - APIOps & Microservices - How HATEOAS changes the way to build and test the APIs

Cloud Side: REST APIs - Best practices
Cloud Side: REST APIs - Best practicesCloud Side: REST APIs - Best practices
Cloud Side: REST APIs - Best practicesNicolas FOATA
 
Building RESTful applications using Spring MVC
Building RESTful applications using Spring MVCBuilding RESTful applications using Spring MVC
Building RESTful applications using Spring MVCIndicThreads
 
Spring-training-in-bangalore
Spring-training-in-bangaloreSpring-training-in-bangalore
Spring-training-in-bangaloreTIB Academy
 
Xamarin Workshop Noob to Master – Week 5
Xamarin Workshop Noob to Master – Week 5Xamarin Workshop Noob to Master – Week 5
Xamarin Workshop Noob to Master – Week 5Charlin Agramonte
 
Constraints Make You Sexy - What is Rest
Constraints Make You Sexy  - What is RestConstraints Make You Sexy  - What is Rest
Constraints Make You Sexy - What is Restanorqiu
 
How to make your API truly RESTful
How to make your API truly RESTfulHow to make your API truly RESTful
How to make your API truly RESTfulRay Sinnema
 
Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2Sumy PHP User Grpoup
 
Great APIs - Future of Your Progress App
Great APIs - Future of Your Progress AppGreat APIs - Future of Your Progress App
Great APIs - Future of Your Progress AppGabriel Lucaciu
 
Accessing REST & Backend as a Service (BaaS) - Developer Direct - Mobile Summ...
Accessing REST & Backend as a Service (BaaS) - Developer Direct - Mobile Summ...Accessing REST & Backend as a Service (BaaS) - Developer Direct - Mobile Summ...
Accessing REST & Backend as a Service (BaaS) - Developer Direct - Mobile Summ...Jim McKeeth
 
Rest and Sling Resolution
Rest and Sling ResolutionRest and Sling Resolution
Rest and Sling ResolutionDEEPAK KHETAWAT
 
Poster Declaratively Describing Responses of Hypermedia-Driven Web APIs
Poster Declaratively Describing Responses of Hypermedia-Driven Web APIsPoster Declaratively Describing Responses of Hypermedia-Driven Web APIs
Poster Declaratively Describing Responses of Hypermedia-Driven Web APIsRuben Taelman
 
Understanding ASP.NET Under The Cover - Miguel A. Castro
Understanding ASP.NET Under The Cover - Miguel A. CastroUnderstanding ASP.NET Under The Cover - Miguel A. Castro
Understanding ASP.NET Under The Cover - Miguel A. CastroMohammad Tayseer
 

Similar to APIDays 2018 - APIOps & Microservices - How HATEOAS changes the way to build and test the APIs (20)

L18 REST API Design
L18 REST API DesignL18 REST API Design
L18 REST API Design
 
Best Practices in Api Design
Best Practices in Api DesignBest Practices in Api Design
Best Practices in Api Design
 
Cloud Side: REST APIs - Best practices
Cloud Side: REST APIs - Best practicesCloud Side: REST APIs - Best practices
Cloud Side: REST APIs - Best practices
 
Rest with Spring
Rest with SpringRest with Spring
Rest with Spring
 
WebApp #3 : API
WebApp #3 : APIWebApp #3 : API
WebApp #3 : API
 
Building RESTful applications using Spring MVC
Building RESTful applications using Spring MVCBuilding RESTful applications using Spring MVC
Building RESTful applications using Spring MVC
 
Spring-training-in-bangalore
Spring-training-in-bangaloreSpring-training-in-bangalore
Spring-training-in-bangalore
 
Xamarin Workshop Noob to Master – Week 5
Xamarin Workshop Noob to Master – Week 5Xamarin Workshop Noob to Master – Week 5
Xamarin Workshop Noob to Master – Week 5
 
Constraints Make You Sexy - What is Rest
Constraints Make You Sexy  - What is RestConstraints Make You Sexy  - What is Rest
Constraints Make You Sexy - What is Rest
 
ASP.NET WEB API Training
ASP.NET WEB API TrainingASP.NET WEB API Training
ASP.NET WEB API Training
 
How to make your API truly RESTful
How to make your API truly RESTfulHow to make your API truly RESTful
How to make your API truly RESTful
 
Web api
Web apiWeb api
Web api
 
Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2
 
Great APIs - Future of Your Progress App
Great APIs - Future of Your Progress AppGreat APIs - Future of Your Progress App
Great APIs - Future of Your Progress App
 
Accessing REST & Backend as a Service (BaaS) - Developer Direct - Mobile Summ...
Accessing REST & Backend as a Service (BaaS) - Developer Direct - Mobile Summ...Accessing REST & Backend as a Service (BaaS) - Developer Direct - Mobile Summ...
Accessing REST & Backend as a Service (BaaS) - Developer Direct - Mobile Summ...
 
APITalkMeetupSharable
APITalkMeetupSharableAPITalkMeetupSharable
APITalkMeetupSharable
 
Rest and Sling Resolution
Rest and Sling ResolutionRest and Sling Resolution
Rest and Sling Resolution
 
Poster Declaratively Describing Responses of Hypermedia-Driven Web APIs
Poster Declaratively Describing Responses of Hypermedia-Driven Web APIsPoster Declaratively Describing Responses of Hypermedia-Driven Web APIs
Poster Declaratively Describing Responses of Hypermedia-Driven Web APIs
 
Web 13 | REST API
Web 13 | REST APIWeb 13 | REST API
Web 13 | REST API
 
Understanding ASP.NET Under The Cover - Miguel A. Castro
Understanding ASP.NET Under The Cover - Miguel A. CastroUnderstanding ASP.NET Under The Cover - Miguel A. Castro
Understanding ASP.NET Under The Cover - Miguel A. Castro
 

Recently uploaded

IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIES VE
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityScyllaDB
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...CzechDreamin
 
Buy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptxBuy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptxEasyPrinterHelp
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfFIDO Alliance
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxJennifer Lim
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfFIDO Alliance
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfFIDO Alliance
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxDavid Michel
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessUXDXConf
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...CzechDreamin
 
Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024TopCSSGallery
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfFIDO Alliance
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsUXDXConf
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераMark Opanasiuk
 
Buy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdfBuy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdfEasyPrinterHelp
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoTAnalytics
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsStefano
 

Recently uploaded (20)

IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
Buy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptxBuy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptx
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering Teams
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Buy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdfBuy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdf
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 

APIDays 2018 - APIOps & Microservices - How HATEOAS changes the way to build and test the APIs

  • 1. How HATEOAS changes the way to build and test the APIs Sam ROTTENBERG API Days, Paris, 30th January 2018
  • 3. 3// HATEOAS Hypermedia As the Engine Of Application State “REST is defined by four interface constraints: - identification of resources; - manipulation of resources through representations; - Selfdescriptive messages; - and, hypermedia as the engine of application state.” [Fielding 2000]
  • 5. 5// Example of web application PAAS Web Application - List apps - App details page - App management operations - Start / Stop - Delete - ...
  • 7. 7// Levels of REST / Richardson Maturity Model Level 0 - HTTP as the communication protocol - Service↔URI - Call semantics contained in custom messages - POST requests - Always 200 status code (even for errors) - SOAP-like (without envelope)
  • 8. 8// Levels of REST / Richardson Maturity Model Level 0 - Example - POST /appService - Request body - <startAppRequest>...</startAppRequest> - Response body (status code 200) - <startAppResponse>...</startAppResponse> - <startAppError>...</startAppError>
  • 9. 9// Levels of REST / Richardson Maturity Model Level 1 - Resources - Resource↔URI - Calling “methods” on resources (object oriented style) - Call semantics (cf. level 0)
  • 10. 10// Levels of REST / Richardson Maturity Model Level 1 - Example - POST /apps/my-app - Request body - <startAppRequest>...</startAppRequest> - Response body (status code 200) - <startAppResponse>...</startAppResponse> - <startAppError>...</startAppError>
  • 11. 11// Levels of REST / Richardson Maturity Model Level 2 - HTTP Verbs + HTTP Response codes - Resource↔URI - Function↔Verb + URI - Comply with HTTP verbs and response codes semantics - GET : safe, does not change state - POST/PUT/DELETE : changes state - 200, 201, 401, 402, etc.
  • 12. 12// Levels of REST / Richardson Maturity Model Level 2 - Example - GET /apps/my-app - 200 Ok with app details in body - PUT /apps/my-app - 204 No Content - DELETE /apps/my-app - 204 No Content - POST /apps - 201 Created
  • 13. 13// Levels of REST / Richardson Maturity Model Level 3 - Enriched resources representations in responses with hypermedia controls - Links to resources or actions related to the current resource - Forms - Datatype information (links to schemas) - ...
  • 14. 14// Levels of REST / Richardson Maturity Model Level 3 - Example <app id=”my-app”> <link rel=”stop” uri=”/apps/my-app/stop” /> ... </app>
  • 16. 16// Immediate advantage of HATEOAS Server knows best - Business rules - Actions depending on access rights - Actions depending on resource state - Level 2 and below - Duplicated rules client-side - Level 3 - HATEOAS - Navigation based on server’s response
  • 18. 18// Going further with HATEOAS I have a dream - Auto-generated static and dynamic API documentation - Scaffolding based on the API documentation - API demo - Testing - Adding semantics (with shared ontologies) - Auto-discovery of services - Client-side development becomes building UI kits for pre-defined semantics
  • 20. 20// HATEOAS Challenges The dark side of the moon - Building HATEOAS API is very difficult - Frameworks are function-oriented and not resource-oriented - Too much workload to maintain documentation by hand - Various formats (HAL, JSON-LD, Hydra, etc.), no standard - Need specific tools/framework