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

PDF
APIDays 2018 - API Development Lifecycle - The secret ingredient behind RESTf...
PPTX
Api best practices
PPTX
Basic auth implementation using raml in mule
PDF
Kamal maisuriya
DOCX
PDF
REST-API overview / concepts
PPTX
Super simple introduction to REST-APIs (2nd version)
PDF
Oracleapps technical trainining in hyderabad
APIDays 2018 - API Development Lifecycle - The secret ingredient behind RESTf...
Api best practices
Basic auth implementation using raml in mule
Kamal maisuriya
REST-API overview / concepts
Super simple introduction to REST-APIs (2nd version)
Oracleapps technical trainining in hyderabad

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

PPTX
Richarson maturity model (HATEOAS)
PDF
REST Api with Asp Core
PPTX
Rest applied
PPTX
Restful web services
PPTX
Service approach for development Rest API in Symfony2
PDF
Richardson Maturity and OpenAPI 3.0
PDF
Road to REST
PPTX
L18 REST API Design
PPTX
RESTful APIs
PPTX
REST Methodologies
PPTX
Hypermedia APIs: The Rest of REST
PPTX
Lies you have been told about REST
PDF
Building Valuable RESTful APIs
PPTX
RESTful Web Services.pptxbnbjmgbjbvvhvhj
PDF
RESTFul APIs
PPTX
REST & RESTful APIs: The State of Confusion
PDF
building-rest-api-with-spring-boot-in28minutes-presentation.pdf
PDF
Five Inconvenient Truths about REST
PPT
APITalkMeetupSharable
PDF
Play! with rest
Richarson maturity model (HATEOAS)
REST Api with Asp Core
Rest applied
Restful web services
Service approach for development Rest API in Symfony2
Richardson Maturity and OpenAPI 3.0
Road to REST
L18 REST API Design
RESTful APIs
REST Methodologies
Hypermedia APIs: The Rest of REST
Lies you have been told about REST
Building Valuable RESTful APIs
RESTful Web Services.pptxbnbjmgbjbvvhvhj
RESTFul APIs
REST & RESTful APIs: The State of Confusion
building-rest-api-with-spring-boot-in28minutes-presentation.pdf
Five Inconvenient Truths about REST
APITalkMeetupSharable
Play! with rest
Ad

Recently uploaded (20)

PDF
The AI Revolution in Customer Service - 2025
PDF
CXOs-Are-you-still-doing-manual-DevOps-in-the-age-of-AI.pdf
PDF
Build Real-Time ML Apps with Python, Feast & NoSQL
PPTX
SGT Report The Beast Plan and Cyberphysical Systems of Control
PDF
Accessing-Finance-in-Jordan-MENA 2024 2025.pdf
PDF
Aug23rd - Mulesoft Community Workshop - Hyd, India.pdf
PDF
MENA-ECEONOMIC-CONTEXT-VC MENA-ECEONOMIC
PDF
Introduction to MCP and A2A Protocols: Enabling Agent Communication
PPTX
AI-driven Assurance Across Your End-to-end Network With ThousandEyes
PDF
Lung cancer patients survival prediction using outlier detection and optimize...
PDF
A symptom-driven medical diagnosis support model based on machine learning te...
PDF
“The Future of Visual AI: Efficient Multimodal Intelligence,” a Keynote Prese...
PPTX
Module 1 Introduction to Web Programming .pptx
PDF
A hybrid framework for wild animal classification using fine-tuned DenseNet12...
PDF
Advancing precision in air quality forecasting through machine learning integ...
PPTX
Internet of Everything -Basic concepts details
PDF
Data Virtualization in Action: Scaling APIs and Apps with FME
PDF
The-Future-of-Automotive-Quality-is-Here-AI-Driven-Engineering.pdf
DOCX
Basics of Cloud Computing - Cloud Ecosystem
PDF
Dell Pro Micro: Speed customer interactions, patient processing, and learning...
The AI Revolution in Customer Service - 2025
CXOs-Are-you-still-doing-manual-DevOps-in-the-age-of-AI.pdf
Build Real-Time ML Apps with Python, Feast & NoSQL
SGT Report The Beast Plan and Cyberphysical Systems of Control
Accessing-Finance-in-Jordan-MENA 2024 2025.pdf
Aug23rd - Mulesoft Community Workshop - Hyd, India.pdf
MENA-ECEONOMIC-CONTEXT-VC MENA-ECEONOMIC
Introduction to MCP and A2A Protocols: Enabling Agent Communication
AI-driven Assurance Across Your End-to-end Network With ThousandEyes
Lung cancer patients survival prediction using outlier detection and optimize...
A symptom-driven medical diagnosis support model based on machine learning te...
“The Future of Visual AI: Efficient Multimodal Intelligence,” a Keynote Prese...
Module 1 Introduction to Web Programming .pptx
A hybrid framework for wild animal classification using fine-tuned DenseNet12...
Advancing precision in air quality forecasting through machine learning integ...
Internet of Everything -Basic concepts details
Data Virtualization in Action: Scaling APIs and Apps with FME
The-Future-of-Automotive-Quality-is-Here-AI-Driven-Engineering.pdf
Basics of Cloud Computing - Cloud Ecosystem
Dell Pro Micro: Speed customer interactions, patient processing, and learning...
Ad

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