SlideShare a Scribd company logo
1 of 22
Download to read offline
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

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

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