SlideShare une entreprise Scribd logo
1  sur  36
Télécharger pour lire hors ligne
Hypermedia API
      Pavel Mitin
   2012 Anadea Inc.
Why does it matter
API,   API,   API,   API,   API,   API,   API,   API,   API,   API,
API,   API,   API,   API,   API,   API,   API,   API,   API,   API,
API,   API,   API,   API,   API,   API,   API,   API,   API,   API,
API,   API,   API,   API,   API,   API,   API,   API,   API,   API,
API,   API,   API,   API,   API,   API,   API,   API,   API,   API,
API,   API,   API,   API,   API,   API,   API,   API,   API,   API,
API,   API,   API,   API,   API,   API,   API,   API,   API,   API,
API,   API,   API,   API,   API,   API,   API,   API,   API,   API,
API,   API,   API,   API,   API,   API,   API,   API,   API,   API,
API,   API,   API,   API,   API,   API,   API,   API,   API,   API..
Problem
Existing APIs are often:
● unclear
● fragile
● not extendable
Possible solution
“WWW is fundamentally a distributed
hypermedia application.” Richard Taylor
Possible solution
“WWW is fundamentally a distributed
hypermedia application.” Richard Taylor

And the application works!
How WEB works
Browsers know how to:
● deal with media types (text/html,
  image/png...)
● navigate via links and submit forms
How WEB works
Browsers know how to:
● deal with media types (text/html,
  image/png...)
● navigate via links and submit forms

Let’s follow the example!!!
Example -- eBay API
GET .../item/180881974947
{
  "name" : "Monty Python and the Holy Grail white rabbit big pointy teeth",
  "id" : "180881974947",
  ...
  "links" : [
    { “type: "application/vnd.ebay.item",
      "rel": "Add item to watchlist",
      "href": "https://.../user/12345678/watchlist/180881974947"},
    { // and a whole lot of other operations ]}


Source: http://www.slideshare.net/josdirksen/rest-from-get-to-hateoas
Media types
●   application/atom+xml
●   image/jpeg
●   audio/vnd.wave
●   application/vnd.buyfolio.listing+json
Hypermedia links
● Embed Links
  ○ <img src="..." />
  ○ <x:include href"..."   />
Hypermedia links
● Embed Links
  ○ <img src="..." />
  ○ <x:include href"..." />
● Outbound Links
  ○ <a href="..." target="_blank">...</a>
Hypermedia links
● Embed Links
  ○ <img src="..." />
  ○ <x:include href"..." />
● Outbound Links
  ○ <a href="..." target="_blank">...</a>
● Templated Links
  ○ <form method="get" action="...">...</form>
  ○ <link href="http://www.example.org/?search={search}"   />
Hypermedia links
● Embed Links
   ○ <img src="..." />
   ○ <x:include href"..." />
● Outbound Links
   ○ <a href="..." target="_blank">...</a>
● Templated Links
   ○ <form method="get" action="...">...</form>
   ○ <link href="http://www.example.org/?search={search}"   />
● Idempotent Links
   ○ <link rel="edit" href="http://example.org/edit/1"/>
   ○ (new XMLHttpRequest()).open("DELETE", "/tags/"+id);
Hypermedia links
● Embed Links
   ○ <img src="..." />
   ○ <x:include href"..." />
● Outbound Links
   ○ <a href="..." target="_blank">...</a>
● Templated Links
   ○ <form method="get" action="...">...</form>
   ○ <link href="http://www.example.org/?search={search}"   />
● Idempotent Links
   ○ <link rel="edit" href="http://example.org/edit/1"/>
   ○ (new XMLHttpRequest()).open("DELETE", "/tags/"+id);
● Non-Idempotent Links
   ○ <form method="post" action="...">...</form>
Hypermedia Design Elements
1.   Base Format
2.   State Transfer
3.   Domain Style
4.   Application Flow
Base format
1.   JSON
2.   XML
3.   XHTML/HTML5
4.   Others (YAML, CSV, Markdown, Protocol
     Buffers)
State Transfer (client-initiated)
1. None (i.e. read-only)
2. Predefined (via external documentation)
3. Ad-Hoc (via in-message hypermedia
   controls)
Domain Style
1. Specific
2. General
3. Agnostic
Domain Style
<!-- domain-specific design -->
<story>
  <id>...</id>
  <estimate>...</estimate>
</story>
Domain Style
/* domain-general design */
{
    "collection" : {
        "items" : {
            { "key" : "id",
              "value" : "12345" }
        ...
Domain Style
<!-- domain-agnostic design -->
<ul class="order">
  <li class="id">...</li>
  <ul class="shipping-address">
    <li class="street-address">...</li>
    ...
I haven't mentioned
● Resources
● Http verbs
● Http status codes
Surfing your API




Source: Building Hypermedia APIs with HTML5 and Node by Mike Amundsen
XHTML as a base format
●   Native support for links and forms
●   Ubiquitous client (browser)
●   XHTML is XML
●   HAML :)
Extending vs versioning
Reasons for a new version:
● A change that alters the meaning or
  functionality of an existing feature or
  element
● A change that causes an existing element to
  disappear or become disallowed
● A change that converts an optional element
  into a required element
Javascript RIA
;)
Criticism
Usually compared to "traditional" REST API
Criticism
● Overcomplicated client
● Extra traffic
Rails and HATEOAS
● lack of abstractions for hypermedia controls
Rails and HATEOAS
● lack of abstractions for hypermedia controls
● confusing terms:
  ○ #resource are two different resources
Rails and HATEOAS
● lack of abstractions for hypermedia controls
● confusing terms:
  ○ #resource are three different resources
● OPTIONS verb
Rails and HATEOAS
● lack of abstractions for hypermedia controls
● confusing terms:
  ○ #resource are three different resources
● OPTIONS verb
● PATCH verb
Rails and HATEOAS
● lack of abstractions for hypermedia controls
● confusing terms:
  ○ #resource are three different resources
● OPTIONS verb
● PATCH verb
● PUT verb
  ○ upsert
  ○ whole resource state
Rails and HATEOAS
● lack of abstractions for hypermedia controls
● confusing terms:
  ○ #resource are three different resources
● OPTIONS verb
● PATCH verb
● PUT verb
  ○ upsert
  ○ whole resource state
● custom media types require custom code
Richardson Maturity Model




Source: http://martinfowler.com/articles/richardsonMaturityModel.html
Books

Contenu connexe

En vedette

HCLT Whitepaper: Legacy Modernization
HCLT Whitepaper: Legacy Modernization HCLT Whitepaper: Legacy Modernization
HCLT Whitepaper: Legacy Modernization HCL Technologies
 
BPM for SOA+ESB+API and cloud
BPM for SOA+ESB+API and cloud BPM for SOA+ESB+API and cloud
BPM for SOA+ESB+API and cloud Alexander SAMARIN
 
How to become a Product Samurai - Chris Lukassen
How to become a Product Samurai - Chris LukassenHow to become a Product Samurai - Chris Lukassen
How to become a Product Samurai - Chris LukassenAvisi B.V.
 
Legacy to industry leader: a modernization case study
Legacy to industry leader: a modernization case studyLegacy to industry leader: a modernization case study
Legacy to industry leader: a modernization case studyOSSCube
 
Twilio Signal 2016 API Architecture
Twilio Signal 2016 API ArchitectureTwilio Signal 2016 API Architecture
Twilio Signal 2016 API ArchitectureTwilio Inc
 
LeaseWeb API Architecture @ APINL Meetup
LeaseWeb API Architecture @ APINL MeetupLeaseWeb API Architecture @ APINL Meetup
LeaseWeb API Architecture @ APINL MeetupRolph Haspers
 
SOA Pattern : Legacy Wrappers
SOA Pattern : Legacy Wrappers SOA Pattern : Legacy Wrappers
SOA Pattern : Legacy Wrappers WSO2
 
Updating Legacy Systems: Making the Financial Case for a Modernization Project
Updating Legacy Systems: Making the Financial Case for a Modernization Project Updating Legacy Systems: Making the Financial Case for a Modernization Project
Updating Legacy Systems: Making the Financial Case for a Modernization Project ILM Professional Services
 
IO State In Distributed API Architecture
IO State In Distributed API ArchitectureIO State In Distributed API Architecture
IO State In Distributed API ArchitectureOwen Rubel
 
Api Abstraction & Api Chaining
Api Abstraction & Api ChainingApi Abstraction & Api Chaining
Api Abstraction & Api ChainingOwen Rubel
 
Legacy modernization, cloud orchestration, api publishing
Legacy modernization, cloud orchestration, api publishingLegacy modernization, cloud orchestration, api publishing
Legacy modernization, cloud orchestration, api publishingkumar gaurav
 
Building a Modern Microservices Architecture at Gilt: The Essentials
Building a Modern Microservices Architecture at Gilt: The EssentialsBuilding a Modern Microservices Architecture at Gilt: The Essentials
Building a Modern Microservices Architecture at Gilt: The EssentialsC4Media
 
ITANA 2016: API Architecture and Implementation
ITANA 2016: API Architecture and ImplementationITANA 2016: API Architecture and Implementation
ITANA 2016: API Architecture and ImplementationColin Bell
 
Building an API Platform for Digital Transformation
Building an API Platform for Digital TransformationBuilding an API Platform for Digital Transformation
Building an API Platform for Digital TransformationWSO2
 
Dc meetup-pure-api-led-connectivity-16x9
Dc meetup-pure-api-led-connectivity-16x9Dc meetup-pure-api-led-connectivity-16x9
Dc meetup-pure-api-led-connectivity-16x9Bruce Schonk -PMP, MBA
 
From a Monolithic to a Distributed API Architecture
 at Eventbrite - Presente...
From a Monolithic to a Distributed API Architecture
 at Eventbrite - Presente...From a Monolithic to a Distributed API Architecture
 at Eventbrite - Presente...
From a Monolithic to a Distributed API Architecture
 at Eventbrite - Presente...Renaud Visage
 
API Architecture
API ArchitectureAPI Architecture
API ArchitectureRyan Kolak
 

En vedette (18)

HCLT Whitepaper: Legacy Modernization
HCLT Whitepaper: Legacy Modernization HCLT Whitepaper: Legacy Modernization
HCLT Whitepaper: Legacy Modernization
 
BPM for SOA+ESB+API and cloud
BPM for SOA+ESB+API and cloud BPM for SOA+ESB+API and cloud
BPM for SOA+ESB+API and cloud
 
How to become a Product Samurai - Chris Lukassen
How to become a Product Samurai - Chris LukassenHow to become a Product Samurai - Chris Lukassen
How to become a Product Samurai - Chris Lukassen
 
Apiworld
ApiworldApiworld
Apiworld
 
Legacy to industry leader: a modernization case study
Legacy to industry leader: a modernization case studyLegacy to industry leader: a modernization case study
Legacy to industry leader: a modernization case study
 
Twilio Signal 2016 API Architecture
Twilio Signal 2016 API ArchitectureTwilio Signal 2016 API Architecture
Twilio Signal 2016 API Architecture
 
LeaseWeb API Architecture @ APINL Meetup
LeaseWeb API Architecture @ APINL MeetupLeaseWeb API Architecture @ APINL Meetup
LeaseWeb API Architecture @ APINL Meetup
 
SOA Pattern : Legacy Wrappers
SOA Pattern : Legacy Wrappers SOA Pattern : Legacy Wrappers
SOA Pattern : Legacy Wrappers
 
Updating Legacy Systems: Making the Financial Case for a Modernization Project
Updating Legacy Systems: Making the Financial Case for a Modernization Project Updating Legacy Systems: Making the Financial Case for a Modernization Project
Updating Legacy Systems: Making the Financial Case for a Modernization Project
 
IO State In Distributed API Architecture
IO State In Distributed API ArchitectureIO State In Distributed API Architecture
IO State In Distributed API Architecture
 
Api Abstraction & Api Chaining
Api Abstraction & Api ChainingApi Abstraction & Api Chaining
Api Abstraction & Api Chaining
 
Legacy modernization, cloud orchestration, api publishing
Legacy modernization, cloud orchestration, api publishingLegacy modernization, cloud orchestration, api publishing
Legacy modernization, cloud orchestration, api publishing
 
Building a Modern Microservices Architecture at Gilt: The Essentials
Building a Modern Microservices Architecture at Gilt: The EssentialsBuilding a Modern Microservices Architecture at Gilt: The Essentials
Building a Modern Microservices Architecture at Gilt: The Essentials
 
ITANA 2016: API Architecture and Implementation
ITANA 2016: API Architecture and ImplementationITANA 2016: API Architecture and Implementation
ITANA 2016: API Architecture and Implementation
 
Building an API Platform for Digital Transformation
Building an API Platform for Digital TransformationBuilding an API Platform for Digital Transformation
Building an API Platform for Digital Transformation
 
Dc meetup-pure-api-led-connectivity-16x9
Dc meetup-pure-api-led-connectivity-16x9Dc meetup-pure-api-led-connectivity-16x9
Dc meetup-pure-api-led-connectivity-16x9
 
From a Monolithic to a Distributed API Architecture
 at Eventbrite - Presente...
From a Monolithic to a Distributed API Architecture
 at Eventbrite - Presente...From a Monolithic to a Distributed API Architecture
 at Eventbrite - Presente...
From a Monolithic to a Distributed API Architecture
 at Eventbrite - Presente...
 
API Architecture
API ArchitectureAPI Architecture
API Architecture
 

Similaire à Hypermedia api (HATEOAS)

The liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIsThe liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIsJorge Ferrer
 
Making Sense of Hypermedia APIs – Hype or Reality?
Making Sense of Hypermedia APIs – Hype or Reality?Making Sense of Hypermedia APIs – Hype or Reality?
Making Sense of Hypermedia APIs – Hype or Reality?Akana
 
Website Optimization -SEO - Step By Step
Website Optimization -SEO - Step By StepWebsite Optimization -SEO - Step By Step
Website Optimization -SEO - Step By StepMia Lee
 
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
 
API Discovery: Visibility, Usability, and Advocacy
API Discovery: Visibility, Usability, and AdvocacyAPI Discovery: Visibility, Usability, and Advocacy
API Discovery: Visibility, Usability, and AdvocacyBill Doerrfeld
 
A Practical Guide to Hypermedia APIs
A Practical Guide to Hypermedia APIsA Practical Guide to Hypermedia APIs
A Practical Guide to Hypermedia APIsSmartLogic
 
01 web 2.0 - more than a pretty face for soa
01   web 2.0 - more than a pretty face for soa01   web 2.0 - more than a pretty face for soa
01 web 2.0 - more than a pretty face for soaTechnology Transfer
 
API Introduction - API Management Workshop Munich from Ronnie Mitra
API Introduction - API Management Workshop Munich from Ronnie MitraAPI Introduction - API Management Workshop Munich from Ronnie Mitra
API Introduction - API Management Workshop Munich from Ronnie MitraCA API Management
 
CSI: WordPress -- Getting Into the Guts
CSI: WordPress -- Getting Into the GutsCSI: WordPress -- Getting Into the Guts
CSI: WordPress -- Getting Into the GutsDougal Campbell
 
WordPress and Client Side Web Applications WCTO
WordPress and Client Side Web Applications WCTOWordPress and Client Side Web Applications WCTO
WordPress and Client Side Web Applications WCTORoy Sivan
 
Wordcamp Toronto Presentation
Wordcamp Toronto PresentationWordcamp Toronto Presentation
Wordcamp Toronto PresentationRoy Sivan
 
Surviving the Zombie Apocalypse of Connected devices - Jfokus 2013
Surviving the Zombie Apocalypse of Connected devices - Jfokus 2013Surviving the Zombie Apocalypse of Connected devices - Jfokus 2013
Surviving the Zombie Apocalypse of Connected devices - Jfokus 2013Gustaf Nilsson Kotte
 
OpenSocial Intro
OpenSocial IntroOpenSocial Intro
OpenSocial IntroPamela Fox
 
On-page SEO for Drupal
On-page SEO for DrupalOn-page SEO for Drupal
On-page SEO for DrupalSvilen Sabev
 
Webcast: Pragmatic REST: The Next Generation
Webcast: Pragmatic REST: The Next GenerationWebcast: Pragmatic REST: The Next Generation
Webcast: Pragmatic REST: The Next GenerationApigee | Google Cloud
 
A Practical Guide To Hypermedia APIs - Philly.rb
A Practical Guide To Hypermedia APIs - Philly.rbA Practical Guide To Hypermedia APIs - Philly.rb
A Practical Guide To Hypermedia APIs - Philly.rbSmartLogic
 

Similaire à Hypermedia api (HATEOAS) (20)

The liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIsThe liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
The liferay case: lessons learned evolving from RPC to Hypermedia REST APIs
 
Making Sense of Hypermedia APIs – Hype or Reality?
Making Sense of Hypermedia APIs – Hype or Reality?Making Sense of Hypermedia APIs – Hype or Reality?
Making Sense of Hypermedia APIs – Hype or Reality?
 
Yahoo for the Masses
Yahoo for the MassesYahoo for the Masses
Yahoo for the Masses
 
Website Optimization -SEO - Step By Step
Website Optimization -SEO - Step By StepWebsite Optimization -SEO - Step By Step
Website Optimization -SEO - Step By Step
 
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
 
API Discovery: Visibility, Usability, and Advocacy
API Discovery: Visibility, Usability, and AdvocacyAPI Discovery: Visibility, Usability, and Advocacy
API Discovery: Visibility, Usability, and Advocacy
 
A Practical Guide to Hypermedia APIs
A Practical Guide to Hypermedia APIsA Practical Guide to Hypermedia APIs
A Practical Guide to Hypermedia APIs
 
01 web 2.0 - more than a pretty face for soa
01   web 2.0 - more than a pretty face for soa01   web 2.0 - more than a pretty face for soa
01 web 2.0 - more than a pretty face for soa
 
API Introduction - API Management Workshop Munich from Ronnie Mitra
API Introduction - API Management Workshop Munich from Ronnie MitraAPI Introduction - API Management Workshop Munich from Ronnie Mitra
API Introduction - API Management Workshop Munich from Ronnie Mitra
 
CSI: WordPress -- Getting Into the Guts
CSI: WordPress -- Getting Into the GutsCSI: WordPress -- Getting Into the Guts
CSI: WordPress -- Getting Into the Guts
 
WordPress and Client Side Web Applications WCTO
WordPress and Client Side Web Applications WCTOWordPress and Client Side Web Applications WCTO
WordPress and Client Side Web Applications WCTO
 
Wordcamp Toronto Presentation
Wordcamp Toronto PresentationWordcamp Toronto Presentation
Wordcamp Toronto Presentation
 
Surviving the Zombie Apocalypse of Connected devices - Jfokus 2013
Surviving the Zombie Apocalypse of Connected devices - Jfokus 2013Surviving the Zombie Apocalypse of Connected devices - Jfokus 2013
Surviving the Zombie Apocalypse of Connected devices - Jfokus 2013
 
OpenSocial Intro
OpenSocial IntroOpenSocial Intro
OpenSocial Intro
 
On-page SEO for Drupal
On-page SEO for DrupalOn-page SEO for Drupal
On-page SEO for Drupal
 
Webcast: Pragmatic REST: The Next Generation
Webcast: Pragmatic REST: The Next GenerationWebcast: Pragmatic REST: The Next Generation
Webcast: Pragmatic REST: The Next Generation
 
The Open Web
The Open WebThe Open Web
The Open Web
 
A Practical Guide To Hypermedia APIs - Philly.rb
A Practical Guide To Hypermedia APIs - Philly.rbA Practical Guide To Hypermedia APIs - Philly.rb
A Practical Guide To Hypermedia APIs - Philly.rb
 
Api craft notes
Api craft notesApi craft notes
Api craft notes
 
API Design Tour: Digital River
API Design Tour: Digital RiverAPI Design Tour: Digital River
API Design Tour: Digital River
 

Dernier

DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 

Dernier (20)

DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 

Hypermedia api (HATEOAS)

  • 1. Hypermedia API Pavel Mitin 2012 Anadea Inc.
  • 2. Why does it matter API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API, API..
  • 3. Problem Existing APIs are often: ● unclear ● fragile ● not extendable
  • 4. Possible solution “WWW is fundamentally a distributed hypermedia application.” Richard Taylor
  • 5. Possible solution “WWW is fundamentally a distributed hypermedia application.” Richard Taylor And the application works!
  • 6. How WEB works Browsers know how to: ● deal with media types (text/html, image/png...) ● navigate via links and submit forms
  • 7. How WEB works Browsers know how to: ● deal with media types (text/html, image/png...) ● navigate via links and submit forms Let’s follow the example!!!
  • 8. Example -- eBay API GET .../item/180881974947 { "name" : "Monty Python and the Holy Grail white rabbit big pointy teeth", "id" : "180881974947", ... "links" : [ { “type: "application/vnd.ebay.item", "rel": "Add item to watchlist", "href": "https://.../user/12345678/watchlist/180881974947"}, { // and a whole lot of other operations ]} Source: http://www.slideshare.net/josdirksen/rest-from-get-to-hateoas
  • 9. Media types ● application/atom+xml ● image/jpeg ● audio/vnd.wave ● application/vnd.buyfolio.listing+json
  • 10. Hypermedia links ● Embed Links ○ <img src="..." /> ○ <x:include href"..." />
  • 11. Hypermedia links ● Embed Links ○ <img src="..." /> ○ <x:include href"..." /> ● Outbound Links ○ <a href="..." target="_blank">...</a>
  • 12. Hypermedia links ● Embed Links ○ <img src="..." /> ○ <x:include href"..." /> ● Outbound Links ○ <a href="..." target="_blank">...</a> ● Templated Links ○ <form method="get" action="...">...</form> ○ <link href="http://www.example.org/?search={search}" />
  • 13. Hypermedia links ● Embed Links ○ <img src="..." /> ○ <x:include href"..." /> ● Outbound Links ○ <a href="..." target="_blank">...</a> ● Templated Links ○ <form method="get" action="...">...</form> ○ <link href="http://www.example.org/?search={search}" /> ● Idempotent Links ○ <link rel="edit" href="http://example.org/edit/1"/> ○ (new XMLHttpRequest()).open("DELETE", "/tags/"+id);
  • 14. Hypermedia links ● Embed Links ○ <img src="..." /> ○ <x:include href"..." /> ● Outbound Links ○ <a href="..." target="_blank">...</a> ● Templated Links ○ <form method="get" action="...">...</form> ○ <link href="http://www.example.org/?search={search}" /> ● Idempotent Links ○ <link rel="edit" href="http://example.org/edit/1"/> ○ (new XMLHttpRequest()).open("DELETE", "/tags/"+id); ● Non-Idempotent Links ○ <form method="post" action="...">...</form>
  • 15. Hypermedia Design Elements 1. Base Format 2. State Transfer 3. Domain Style 4. Application Flow
  • 16. Base format 1. JSON 2. XML 3. XHTML/HTML5 4. Others (YAML, CSV, Markdown, Protocol Buffers)
  • 17. State Transfer (client-initiated) 1. None (i.e. read-only) 2. Predefined (via external documentation) 3. Ad-Hoc (via in-message hypermedia controls)
  • 18. Domain Style 1. Specific 2. General 3. Agnostic
  • 19. Domain Style <!-- domain-specific design --> <story> <id>...</id> <estimate>...</estimate> </story>
  • 20. Domain Style /* domain-general design */ { "collection" : { "items" : { { "key" : "id", "value" : "12345" } ...
  • 21. Domain Style <!-- domain-agnostic design --> <ul class="order"> <li class="id">...</li> <ul class="shipping-address"> <li class="street-address">...</li> ...
  • 22. I haven't mentioned ● Resources ● Http verbs ● Http status codes
  • 23. Surfing your API Source: Building Hypermedia APIs with HTML5 and Node by Mike Amundsen
  • 24. XHTML as a base format ● Native support for links and forms ● Ubiquitous client (browser) ● XHTML is XML ● HAML :)
  • 25. Extending vs versioning Reasons for a new version: ● A change that alters the meaning or functionality of an existing feature or element ● A change that causes an existing element to disappear or become disallowed ● A change that converts an optional element into a required element
  • 27. Criticism Usually compared to "traditional" REST API
  • 29. Rails and HATEOAS ● lack of abstractions for hypermedia controls
  • 30. Rails and HATEOAS ● lack of abstractions for hypermedia controls ● confusing terms: ○ #resource are two different resources
  • 31. Rails and HATEOAS ● lack of abstractions for hypermedia controls ● confusing terms: ○ #resource are three different resources ● OPTIONS verb
  • 32. Rails and HATEOAS ● lack of abstractions for hypermedia controls ● confusing terms: ○ #resource are three different resources ● OPTIONS verb ● PATCH verb
  • 33. Rails and HATEOAS ● lack of abstractions for hypermedia controls ● confusing terms: ○ #resource are three different resources ● OPTIONS verb ● PATCH verb ● PUT verb ○ upsert ○ whole resource state
  • 34. Rails and HATEOAS ● lack of abstractions for hypermedia controls ● confusing terms: ○ #resource are three different resources ● OPTIONS verb ● PATCH verb ● PUT verb ○ upsert ○ whole resource state ● custom media types require custom code
  • 35. Richardson Maturity Model Source: http://martinfowler.com/articles/richardsonMaturityModel.html
  • 36. Books