SlideShare a Scribd company logo
BENEFITS OF
HYPERMEDIA APIS
Paulo Gandra de
Sousa
pagsousa@gmail.co
m
Hypermedia is defined by the
presence of application
control information
embedded within, or as a
layer above, the presentation
of information.
Mike Amudsen
3
“
THE HYPERMEDIA
CONSTRAINT
Hipermedia as the
engine of application
state *
* HATEOAS
“
HYPERMEDIA IS THE ENGINE
Hypermedia payloads carry more
information than just the data stored
on the server. Hypermedia payloads
carry two types of vital metadata:
metadata about the data itself and
metadata about the possible options
for modifying the state of the
application at that moment.
Mike Amudsen
5
THE HYPERMEDIA
CONSTRAINT
The application is therefore an
engine that moves from one state
to the next by examining and
choosing from among the
alternative state transitions in the
current set of representations.
Roy Fielding
6
“
IMMEDIATE BENEFITS
Explorable API
Inline documentation
Simple client logic
7
“BILLBOARD” ENDPOINT
GET /api
8
200 Ok
<links>
<link rel=“…” href=“…”/>
<link rel=“…” href=“…”/>
...
</links>
LINKED DATA PRINCIPLES
1.Use URIs as names for things
2.Use HTTP URIs so that people can look up those
names.
3.When someone looks up a URI, provide useful
information, using the standards
4.Include links to other URIs so that they can
discover more things.
Tim Berners-Lee (2006)
http://www.w3.org/DesignIssues/LinkedData.html
9
EXAMPLE: CHECK BANK ACCOUNT
BALANCE
EXPLORABLE API + INLINE
DOCUMENTATION
GET /account/12345
200 OK
<?xml version="1.0"?>
<account>
<account_number>12345</account_number>
<link rel=“self” href=“/account/12345” />
<balance currency="usd">100.00</balance>
<link rel=“http://bank.org/rel/first-subscriber" href="/customer/123" />
<link rel=“http://bank.org/rel/subscribers" href="/account/12345/subscriber" />
<link rel="http://bank.org/rel/deposit" href="/account/12345/deposit" />
<link rel="http://bank.org/rel/withdraw" href="/account/12345/withdraw" />
<link rel="http://bank.org/rel/transfer" href="/account/12345/transfer" />
<link rel="http://bank.org/rel/close" href="/account/12345/close" />
</account>
10
Semantic
and
documentati
on
Use URI as
names
Explorable
CLIENT SIMPLICITY
Coupled to
implementation
res = GET /account/123
If enough-funds() then
msg = build-withdraw-
message()
url = build-url-from-
template()
POST msg @ url
Endif
Hypermedia-driven
res = GET /account/123
If res.hasLink(“withdraw”) then
msg = build-withdraw-
message()
POST msg @
res.link(“withdraw”)
Endif
11
Needs to
know URL
template
Business
logic spills
out to client
Server
handles
Business
logic
Server
manages URL
structure
VS
FLEXIBILITY & EVOLUTION
Server takes ownership of URL
Offloading content
Upgrading
12
EXAMPLE: CHECK BANK ACCOUNT
BALANCE
SERVER MODIFIES URL
STRUCTURE
GET /account/12345
200 OK
<?xml version="1.0"?>
<account>
<account_number>12345</account_number>
<link rel=“self” href=“/account/12345” />
<balance currency="usd">100.00</balance>
<link rel=“http://bank.org/rel/first-subscriber"
href=“/crm/123?role=customer" />
<link rel=“http://bank.org/rel/subscribers" href="/account/12345/subscriber" />
<link rel="http://bank.org/rel/deposit" href="/account/12345/deposit" />
<link rel="http://bank.org/rel/withdraw" href="/account/12345/withdraw" />
<link rel="http://bank.org/rel/transfer" href="/account/12345/transfer" />
<link rel="http://bank.org/rel/close" href="/account/12345/close" />
</account>
13
New URL; no
problem client just
follows it
EXAMPLE: CHECK BANK ACCOUNT
BALANCE
CONTENT OFFLOADING
GET /account/12345
200 OK
<?xml version="1.0"?>
<account>
<account_number>12345</account_number>
<link rel=“self” href=“/account/12345” />
<balance currency="usd">100.00</balance>
<link rel=“http://bank.org/rel/first-subscriber"
href=“http://one-crm.com/api/tenant/bankABC/prospect/754" />
<link rel=“http://bank.org/rel/pricing"
href=“http://bankABC.cdn.akamai.com/static/pricing" />
...
</account>
14
Content offloaded
to 3rd party
providers
EXAMPLE: CHECK BANK ACCOUNT
BALANCE
SERVER UPGRADE
GET /account/12345
200 OK
<?xml version="1.0"?>
<account>
<account_number>12345</account_number>
<link rel=“self” href=“/account/12345” />
<balance currency="usd">100.00</balance>
<link rel=“http://bank.org/rel/first-subscriber"
href=“http://one-crm.com/api/tenant/bankABC/prospect/754" />
<link rel=“http://bank.org/rel/pricing"
href=“http://bankABC.cdn.akamai.com/static/pricing" />
<link rel="http://bank.org/rel/deposit"
href="/account/12345/deposit"
type=“application/vnd.bankABC.deposit.v2+xml,
application/vnd.bankABC.deposit+xml” />
...
</account> 15
New relationship;
only V2 clients will
know it
New media type
accepted; only V2
clients will know it
16
CLOSINGS
1. Adhere to the
hypermedia constraint
2. Aim for a “billboard”
API
3. Decouple client and
server
REFERENCES
Jørn Wildt (2013) Selling the benefits of hypermedia APIs.
http://soabits.blogspot.no/2013/12/selling-benefits-
of-hypermedia.html
David (2012) Getting hyper about hypermedia APIs.
https://signalvnoise.com/posts/3373-getting-hyper-
about-hypermedia-apis
“Architectural Styles and the Design of Network-based
Software Architectures”, PhD Thesis (2000), Roy Thomas
Fielding.
http://www.ics.uci.edu/~fielding/pubs/dissertation/top.
htm
Leonard Richardson, Mike Amundsen, RESTful web APIs.
O’Reily Media. ISBN: 1449358063

More Related Content

PPTX
Introduction to Node.js
PPTX
Web services SOAP
PPTX
Onion Architecture / Clean Architecture
PPTX
Api design part 1
PPTX
Cloud Service Models
PPTX
Web Development
PDF
Migrating Monoliths to Microservices -- M3
PDF
Virtualization presentation
Introduction to Node.js
Web services SOAP
Onion Architecture / Clean Architecture
Api design part 1
Cloud Service Models
Web Development
Migrating Monoliths to Microservices -- M3
Virtualization presentation

What's hot (20)

PPTX
Virtual Private Networks (VPN) ppt
PPTX
Advance Java Topics (J2EE)
PPT
Netbeans IDE & Platform
PPT
Java tutorial PPT
PDF
HOSPITAL MANAGEMENT SYSTEM project report
PPTX
Cloud security
PPTX
Public vs private vs hybrid cloud what is best for your business-
PPT
Javascript
PPTX
PDF
J2EE Introduction
PPTX
Introduction to Aneka, Aneka Model is explained
PPTX
Multiple inheritance in java3 (1).pptx
PPTX
Presentation on Cloud computing
DOCX
Cloud computing notes unit II
PPTX
Introduction to MERN Stack
PPTX
AWS PPT.pptx
PPTX
Cloud Computing for college presenation project.
PPT
Web development | Derin Dolen
PPTX
cluster computing
Virtual Private Networks (VPN) ppt
Advance Java Topics (J2EE)
Netbeans IDE & Platform
Java tutorial PPT
HOSPITAL MANAGEMENT SYSTEM project report
Cloud security
Public vs private vs hybrid cloud what is best for your business-
Javascript
J2EE Introduction
Introduction to Aneka, Aneka Model is explained
Multiple inheritance in java3 (1).pptx
Presentation on Cloud computing
Cloud computing notes unit II
Introduction to MERN Stack
AWS PPT.pptx
Cloud Computing for college presenation project.
Web development | Derin Dolen
cluster computing
Ad

Viewers also liked (15)

PDF
Patterns of Enterprise Application Architecture (by example)
PDF
Enterprise Integration Patterns
PDF
PoEAA by Example
PDF
Rest web services
PPTX
Patterns for distributed systems
PDF
Lição prova professor coordenador
PPTX
Principles of Service Orientation
PPT
REST beyond CRUD
PPT
Modern web architectural patterns
PPTX
Design Patterns: From STUPID to SOLID code
PDF
Decoupled Communication
PPTX
RESTful services Design Lab
PDF
Communication
PDF
OO design principles and patterns
PDF
Software Product Lines
Patterns of Enterprise Application Architecture (by example)
Enterprise Integration Patterns
PoEAA by Example
Rest web services
Patterns for distributed systems
Lição prova professor coordenador
Principles of Service Orientation
REST beyond CRUD
Modern web architectural patterns
Design Patterns: From STUPID to SOLID code
Decoupled Communication
RESTful services Design Lab
Communication
OO design principles and patterns
Software Product Lines
Ad

Similar to Benefits of Hypermedia API (20)

PDF
Talking to 25% of the web - In-depth report and analysis on the WordPress RES...
PPT
4163A - What is Web 2.0.ppt
PPT
Web2 0 Incredibles
PDF
How to use Informatica Power Center as a RESTful Web Service Client?
PDF
Getting Started with API Management
PDF
Introduction To CodeIgniter
PDF
How to use Informatica Power Center as a RESTful Web Service Client?
PPT
REST.ppt
PDF
Entity Linking and REST Patterns in SOA
PDF
Easy integration of Bluemix services with your applications
PPT
Agilewiz PaaS, SaaS, Web 2.5, Platform Technology, BPO Platform Technology,Di...
PPTX
IBM Innovate 2013: Making Rational HATS a Strategic Investment
PDF
IRJET- Lightweight MVC Framework in PHP
PPT
Oracle Enterprise 2.0 & Business Applications
PDF
Microservices: Decomposing Applications for Deployability and Scalability (ja...
PPTX
AWS CloudFormation Automation, TrafficScript, and Serverless architecture wit...
PPT
Connected Architecture Fabric Creating a Connected World
PPTX
Micro service architecture
PPT
Oracle Applications R12 architecture
PPTX
WebApplicationArchitectureAzure.pptx
Talking to 25% of the web - In-depth report and analysis on the WordPress RES...
4163A - What is Web 2.0.ppt
Web2 0 Incredibles
How to use Informatica Power Center as a RESTful Web Service Client?
Getting Started with API Management
Introduction To CodeIgniter
How to use Informatica Power Center as a RESTful Web Service Client?
REST.ppt
Entity Linking and REST Patterns in SOA
Easy integration of Bluemix services with your applications
Agilewiz PaaS, SaaS, Web 2.5, Platform Technology, BPO Platform Technology,Di...
IBM Innovate 2013: Making Rational HATS a Strategic Investment
IRJET- Lightweight MVC Framework in PHP
Oracle Enterprise 2.0 & Business Applications
Microservices: Decomposing Applications for Deployability and Scalability (ja...
AWS CloudFormation Automation, TrafficScript, and Serverless architecture wit...
Connected Architecture Fabric Creating a Connected World
Micro service architecture
Oracle Applications R12 architecture
WebApplicationArchitectureAzure.pptx

More from Paulo Gandra de Sousa (9)

PDF
Introduction to Microservices
PPTX
Minds-on DDD
PPTX
Introduction to microservices
PPTX
Design Patterns: Back to Basics
PPTX
Hypermedia APIs
PPTX
Revision control with Mercurial
PDF
Documenting Software Architectures
PDF
models of distributed computing
PDF
Distributed Systems
Introduction to Microservices
Minds-on DDD
Introduction to microservices
Design Patterns: Back to Basics
Hypermedia APIs
Revision control with Mercurial
Documenting Software Architectures
models of distributed computing
Distributed Systems

Recently uploaded (20)

PDF
KodekX | Application Modernization Development
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Empathic Computing: Creating Shared Understanding
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
DOCX
The AUB Centre for AI in Media Proposal.docx
KodekX | Application Modernization Development
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Chapter 3 Spatial Domain Image Processing.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Review of recent advances in non-invasive hemoglobin estimation
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Diabetes mellitus diagnosis method based random forest with bat algorithm
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Building Integrated photovoltaic BIPV_UPV.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Mobile App Security Testing_ A Comprehensive Guide.pdf
MYSQL Presentation for SQL database connectivity
Dropbox Q2 2025 Financial Results & Investor Presentation
Empathic Computing: Creating Shared Understanding
Agricultural_Statistics_at_a_Glance_2022_0.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
The AUB Centre for AI in Media Proposal.docx

Benefits of Hypermedia API

  • 1. BENEFITS OF HYPERMEDIA APIS Paulo Gandra de Sousa pagsousa@gmail.co m
  • 2. Hypermedia is defined by the presence of application control information embedded within, or as a layer above, the presentation of information. Mike Amudsen 3 “
  • 3. THE HYPERMEDIA CONSTRAINT Hipermedia as the engine of application state * * HATEOAS
  • 4. “ HYPERMEDIA IS THE ENGINE Hypermedia payloads carry more information than just the data stored on the server. Hypermedia payloads carry two types of vital metadata: metadata about the data itself and metadata about the possible options for modifying the state of the application at that moment. Mike Amudsen 5
  • 5. THE HYPERMEDIA CONSTRAINT The application is therefore an engine that moves from one state to the next by examining and choosing from among the alternative state transitions in the current set of representations. Roy Fielding 6 “
  • 6. IMMEDIATE BENEFITS Explorable API Inline documentation Simple client logic 7
  • 7. “BILLBOARD” ENDPOINT GET /api 8 200 Ok <links> <link rel=“…” href=“…”/> <link rel=“…” href=“…”/> ... </links>
  • 8. LINKED DATA PRINCIPLES 1.Use URIs as names for things 2.Use HTTP URIs so that people can look up those names. 3.When someone looks up a URI, provide useful information, using the standards 4.Include links to other URIs so that they can discover more things. Tim Berners-Lee (2006) http://www.w3.org/DesignIssues/LinkedData.html 9
  • 9. EXAMPLE: CHECK BANK ACCOUNT BALANCE EXPLORABLE API + INLINE DOCUMENTATION GET /account/12345 200 OK <?xml version="1.0"?> <account> <account_number>12345</account_number> <link rel=“self” href=“/account/12345” /> <balance currency="usd">100.00</balance> <link rel=“http://bank.org/rel/first-subscriber" href="/customer/123" /> <link rel=“http://bank.org/rel/subscribers" href="/account/12345/subscriber" /> <link rel="http://bank.org/rel/deposit" href="/account/12345/deposit" /> <link rel="http://bank.org/rel/withdraw" href="/account/12345/withdraw" /> <link rel="http://bank.org/rel/transfer" href="/account/12345/transfer" /> <link rel="http://bank.org/rel/close" href="/account/12345/close" /> </account> 10 Semantic and documentati on Use URI as names Explorable
  • 10. CLIENT SIMPLICITY Coupled to implementation res = GET /account/123 If enough-funds() then msg = build-withdraw- message() url = build-url-from- template() POST msg @ url Endif Hypermedia-driven res = GET /account/123 If res.hasLink(“withdraw”) then msg = build-withdraw- message() POST msg @ res.link(“withdraw”) Endif 11 Needs to know URL template Business logic spills out to client Server handles Business logic Server manages URL structure VS
  • 11. FLEXIBILITY & EVOLUTION Server takes ownership of URL Offloading content Upgrading 12
  • 12. EXAMPLE: CHECK BANK ACCOUNT BALANCE SERVER MODIFIES URL STRUCTURE GET /account/12345 200 OK <?xml version="1.0"?> <account> <account_number>12345</account_number> <link rel=“self” href=“/account/12345” /> <balance currency="usd">100.00</balance> <link rel=“http://bank.org/rel/first-subscriber" href=“/crm/123?role=customer" /> <link rel=“http://bank.org/rel/subscribers" href="/account/12345/subscriber" /> <link rel="http://bank.org/rel/deposit" href="/account/12345/deposit" /> <link rel="http://bank.org/rel/withdraw" href="/account/12345/withdraw" /> <link rel="http://bank.org/rel/transfer" href="/account/12345/transfer" /> <link rel="http://bank.org/rel/close" href="/account/12345/close" /> </account> 13 New URL; no problem client just follows it
  • 13. EXAMPLE: CHECK BANK ACCOUNT BALANCE CONTENT OFFLOADING GET /account/12345 200 OK <?xml version="1.0"?> <account> <account_number>12345</account_number> <link rel=“self” href=“/account/12345” /> <balance currency="usd">100.00</balance> <link rel=“http://bank.org/rel/first-subscriber" href=“http://one-crm.com/api/tenant/bankABC/prospect/754" /> <link rel=“http://bank.org/rel/pricing" href=“http://bankABC.cdn.akamai.com/static/pricing" /> ... </account> 14 Content offloaded to 3rd party providers
  • 14. EXAMPLE: CHECK BANK ACCOUNT BALANCE SERVER UPGRADE GET /account/12345 200 OK <?xml version="1.0"?> <account> <account_number>12345</account_number> <link rel=“self” href=“/account/12345” /> <balance currency="usd">100.00</balance> <link rel=“http://bank.org/rel/first-subscriber" href=“http://one-crm.com/api/tenant/bankABC/prospect/754" /> <link rel=“http://bank.org/rel/pricing" href=“http://bankABC.cdn.akamai.com/static/pricing" /> <link rel="http://bank.org/rel/deposit" href="/account/12345/deposit" type=“application/vnd.bankABC.deposit.v2+xml, application/vnd.bankABC.deposit+xml” /> ... </account> 15 New relationship; only V2 clients will know it New media type accepted; only V2 clients will know it
  • 16. 1. Adhere to the hypermedia constraint 2. Aim for a “billboard” API 3. Decouple client and server
  • 18. Jørn Wildt (2013) Selling the benefits of hypermedia APIs. http://soabits.blogspot.no/2013/12/selling-benefits- of-hypermedia.html David (2012) Getting hyper about hypermedia APIs. https://signalvnoise.com/posts/3373-getting-hyper- about-hypermedia-apis “Architectural Styles and the Design of Network-based Software Architectures”, PhD Thesis (2000), Roy Thomas Fielding. http://www.ics.uci.edu/~fielding/pubs/dissertation/top. htm Leonard Richardson, Mike Amundsen, RESTful web APIs. O’Reily Media. ISBN: 1449358063

Editor's Notes

  • #2: http://www.v3.co.uk/IMG/063/257063/web-http-url-address-internet-online-www.jpg
  • #5: From wikipedia: http://en.wikipedia.org/wiki/HATEOAS This principle is the key differentiator between a REST and most other forms of client server system. Rather than the actions and interfaces a client may use being defined elsewhere, such as in a WSDL file or predefined in the client code, the principle is that the hypermedia in eachserver response will contain links that correspond to all the actions that the client can currently perform. Therefore, dependent on the current application state, every server response describes the new actions that are available. The server can change the range of allowable responses in a dynamic way, and a client should adapt its behavior to these changes. A client of a RESTful application need only know a single fixed URL to access it. All future actions should be discoverable dynamically from hypermedia links included in the representations of the resources that are returned from that URL. Standardized media types are also expected to be understood by any client that might use a RESTful API. Application state transitions are driven by a combination of the known processing rules for each media type, client selection from the server-provided choices in representations received, and the user's manipulation of those representations. Thus interactions are driven by hypermedia, rather than by any out-of-band information.[1] If necessary, the client’s knowledge of media types, resource communication mechanisms, and user interaction, may be improved on-the-fly by the transmission of code-on-demand from the server to the client as defined elsewhere in the REST architecture.[2]
  • #8: http://soabits.blogspot.no/2013/12/selling-benefits-of-hypermedia.html
  • #9: Single entry point URI /api Everything else is discovered thru links
  • #10: http://www.w3.org/DesignIssues/LinkedData.html
  • #11: Based on http://restcookbook.com/Basics/hateoas/
  • #13: http://soabits.blogspot.no/2013/12/selling-benefits-of-hypermedia.html
  • #14: Based on http://restcookbook.com/Basics/hateoas/
  • #15: Based on http://restcookbook.com/Basics/hateoas/
  • #16: Old clients will ignore the relationships they don’t understand and will continue to send V1 representations while new clients will understand the new relationships and will take advantage of V2 representations
  • #17: http://www.newswire.com/blog/wp-content/uploads/2015/02/Expert-Strategies-for-Writing-Your-Press-Release-Summary.jpg
  • #19: http://www.pdgm.com/getmedia/49986e29-2fba-4629-8a09-591205b91ed4/Library_1400_800.jpg.aspx