SlideShare a Scribd company logo
1 of 37
Chris Marinos presents:
Hypermedia APIs:
The Rest of REST
The Agenda
❖ REST overview
❖ Hypermedia
❖ Affordances
❖ Demo
Who has written or consumed a REST API?
What is REST?
–Chris Marinos
REST APIs are where you, like, follow HTTP and stuff
Representational State Transfer (REST) is a
software architecture style consisting of guidelines
and best practices for creating scalable web
services. REST is a coordinated set of constraints
applied to the design of components in a distributed
hypermedia system that can lead to a more
performant and maintainable architecture.
Representational State Transfer (REST) is a
software architecture style consisting of guidelines
and best practices for creating scalable web
services. REST is a coordinated set of constraints
applied to the design of components in a distributed
hypermedia system that can lead to a more
performant and maintainable architecture.
REST is the architectural style of the internet
REST Constraints
❖ Client-Server
❖ Stateless
❖ Cache
❖ Uniform Interface
❖ Layered System
❖ Code-On-Demand (optional)
REST Benefits
❖ Client-Server -> reuse across clients
❖ Stateless -> scalability/reliability
❖ Cache -> performance
❖ Uniform Interface -> simplicity of interaction
❖ Layered System -> visibility
❖ Code-On-Demand (optional) -> extensibility of client
No HTTP?
–Roy Fielding
“…if the engine of application state (and hence the
API) is not being driven by hypertext, then it cannot
be RESTful and cannot be a REST API. Period.”
The Agenda
❖ REST overview
❖ Hypermedia
❖ Affordances
❖ Demo
HATEOAS
Hypertext as the Engine of Application State
(also a horrible acronym)
So what is hypermedia?
Richardson Maturity Model
Level 0: Pox
Level 1: Resources
Level 2: HTTP Verbs
Level 3: Hypermedia Controls
REST
Level 0: POX
POST /myservice/
{
method: ‘get_customer’
customer_id: 1235
}
POST /myservice/
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-
encoding">
<soap:Body xmlns:m="http://www.example.org/stock">
<m:GetCustomer>
<m:CustomerId>1234</m:CustomerId>
</m:GetCustomer>
</soap:Body>
</soap:Envelope>
Level 1: Resources
POST /customer/
{ method: ‘get_customer’, customer_id: 1234}
POST /organization/
{ method: ‘get_organization’, organization_id: 1234}
POST /organization/
{
method: ‘create_organization’,
organization_id: 1234,
name: ‘new name’
}
Level 2: Verbs
GET /organizations/
————————
{
organization_id: 1234
name: ‘Cool Stuff Inc.’
}
POST /organizations/
{
organization_id: 999
name: ‘My New Organization’
}
GET /organizations/999
————————
{
organization_id: 999
name: ‘My New Organization’
}
Level 3: Hypermedia
GET /organizations/
<form name="input" method=“post" action=“/organizations/“>
Name: <input type="text" name=“organization_name">
<input type="submit" value="Submit">
</form>
POST /organizations/
{
organization_id: 1234
name: ‘My RESTful Organization’
}
The Agenda
❖ REST overview
❖ Hypermedia
❖ Affordances
❖ Demo
“A REST API should be entered with no prior
knowledge beyond the initial URI (bookmark) and set
of standardized media types that are appropriate for
the intended audience (i.e., expected to be
understood by any client that might use the API)”
–Roy Fielding
Affordances
State transitions over URL structure
Hypermedia Benefits
• API discoverability and documentation
• Reuse of state transition logic across clients
• Ease of client development
• More flexibility for servers to evolve
Hypermedia Formats
HTML
XHTML
Collection+JSON
Siren
HAL
JSON-LD
NOT JSON or XML
Collection+JSON
{
"collection" :
{
"version" : “1.0",
"href" : “https://foo.com/api/“,
"links" : […],
"items" : […],
"queries" : […],
"template" : {…}
}
}
Links
"links" : [
{
"href": “https://foo.com/api/organizations/",
"rel": "organizations"
},
{
"href": “https://foo.com/api/customers/",
"rel": "customers"
},
],
Items
"items": [
{
"href": “https://foo.com/api/organizations/1/",
"data": [
{
"name": “organization_id”,
"value": “my_org”
}
],
"links": [
{
“href": “https://foo.com/api/organizations/1/customers“,
"rel": "customers"
},
]
}
]
Queries
"queries" : [
{"rel" : "search",
"href" : “https://foo.com/api/customers/search”,
"data" : [
{"name" : “last_name", "value" : ""}
]
}
],
Template
"template" : {
"data" : [
{"name" : “fist_name”, "value" : "", "prompt" : “First name”},
{"name" : “last_name”, "value" : "", "prompt" : “Last name"},
]
}
The Agenda
❖ REST overview
❖ Hypermedia
❖ Affordances
❖ Demo
Who’s using this stuff?
Who has written or consumed a REST API?
Questions?
❖ API Craft Google group/mailing list
❖ RESTful Web APIs (Richardson/Amundsen)
❖ Roy Fielding’s thesis/blog
❖ Hypermedia formats (HAL, Siren, Hydra, CJ, JSON-LD,
UBER, etc.)
❖ API Craft conference in Detroit (http://apicraft.org/)

More Related Content

What's hot

Rest & RESTful WebServices
Rest & RESTful WebServicesRest & RESTful WebServices
Rest & RESTful WebServicesPrateek Tandon
 
REST - Representational State Transfer
REST - Representational State TransferREST - Representational State Transfer
REST - Representational State TransferPeter R. Egli
 
Soap and restful webservice
Soap and restful webserviceSoap and restful webservice
Soap and restful webserviceDong Ngoc
 
REST and RESTful Web Services
REST and RESTful Web ServicesREST and RESTful Web Services
REST and RESTful Web ServicesKasun Madusanke
 
RESTful services
RESTful servicesRESTful services
RESTful servicesgouthamrv
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUDPrem Sanil
 
introduction about REST API
introduction about REST APIintroduction about REST API
introduction about REST APIAmilaSilva13
 
Introduction to webservices
Introduction to webservicesIntroduction to webservices
Introduction to webservicesGagandeep Singh
 
How to build a rest api.pptx
How to build a rest api.pptxHow to build a rest api.pptx
How to build a rest api.pptxHarry Potter
 
SQL Server Service Broker – A Competent Architecture by Microsoft
SQL Server Service Broker – A Competent Architecture by MicrosoftSQL Server Service Broker – A Competent Architecture by Microsoft
SQL Server Service Broker – A Competent Architecture by Microsoftsara stanford
 
An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST Ram Awadh Prasad, PMP
 

What's hot (20)

Rest & RESTful WebServices
Rest & RESTful WebServicesRest & RESTful WebServices
Rest & RESTful WebServices
 
REST - Representational State Transfer
REST - Representational State TransferREST - Representational State Transfer
REST - Representational State Transfer
 
Soap and restful webservice
Soap and restful webserviceSoap and restful webservice
Soap and restful webservice
 
Rest surekha
Rest surekhaRest surekha
Rest surekha
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 
REST and RESTful Web Services
REST and RESTful Web ServicesREST and RESTful Web Services
REST and RESTful Web Services
 
Implementation advantages of rest
Implementation advantages of restImplementation advantages of rest
Implementation advantages of rest
 
RESTful services
RESTful servicesRESTful services
RESTful services
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUD
 
introduction about REST API
introduction about REST APIintroduction about REST API
introduction about REST API
 
Web services for banks
Web services for banksWeb services for banks
Web services for banks
 
RESTful Web Services
RESTful Web ServicesRESTful Web Services
RESTful Web Services
 
Rest
RestRest
Rest
 
Rest web services
Rest web servicesRest web services
Rest web services
 
Introduction to webservices
Introduction to webservicesIntroduction to webservices
Introduction to webservices
 
REST Presentation
REST PresentationREST Presentation
REST Presentation
 
Introduction To REST
Introduction To RESTIntroduction To REST
Introduction To REST
 
How to build a rest api.pptx
How to build a rest api.pptxHow to build a rest api.pptx
How to build a rest api.pptx
 
SQL Server Service Broker – A Competent Architecture by Microsoft
SQL Server Service Broker – A Competent Architecture by MicrosoftSQL Server Service Broker – A Competent Architecture by Microsoft
SQL Server Service Broker – A Competent Architecture by Microsoft
 
An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST
 

Similar to Hypermedia APIs: The Rest of REST

Together Cheerfully to Walk with Hypermedia
Together Cheerfully to Walk with HypermediaTogether Cheerfully to Walk with Hypermedia
Together Cheerfully to Walk with HypermediaVladimir Tsukur
 
JAX-RS. Developing RESTful APIs with Java
JAX-RS. Developing RESTful APIs with JavaJAX-RS. Developing RESTful APIs with Java
JAX-RS. Developing RESTful APIs with JavaJerry Kurian
 
Restful webservices
Restful webservicesRestful webservices
Restful webservicesKong King
 
REST and Resource Oriented Architecture - okcDG March 2008
REST and Resource Oriented Architecture - okcDG March 2008REST and Resource Oriented Architecture - okcDG March 2008
REST and Resource Oriented Architecture - okcDG March 2008Ryan Hoegg
 
Hypermedia APIs and HATEOAS
Hypermedia APIs and HATEOASHypermedia APIs and HATEOAS
Hypermedia APIs and HATEOASVladimir Tsukur
 
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...Codemotion
 
Cdm mil-18 - hypermedia ap is for headless platforms and data integration
Cdm mil-18 - hypermedia ap is for headless platforms and data integrationCdm mil-18 - hypermedia ap is for headless platforms and data integration
Cdm mil-18 - hypermedia ap is for headless platforms and data integrationDavid Gómez García
 
rest-api-basics.pptx
rest-api-basics.pptxrest-api-basics.pptx
rest-api-basics.pptxFikiRieza2
 
SAP ODATA Overview & Guidelines
SAP ODATA Overview & GuidelinesSAP ODATA Overview & Guidelines
SAP ODATA Overview & GuidelinesAshish Saxena
 
Design Summit - RESTful API Overview - John Hardy
Design Summit - RESTful API Overview - John HardyDesign Summit - RESTful API Overview - John Hardy
Design Summit - RESTful API Overview - John HardyManageIQ
 
Web Apps for the Masses
Web Apps for the MassesWeb Apps for the Masses
Web Apps for the MassesDavid Tufts
 
WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!
WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!
WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!Evan Mullins
 

Similar to Hypermedia APIs: The Rest of REST (20)

Switch to Backend 2023
Switch to Backend 2023Switch to Backend 2023
Switch to Backend 2023
 
Together Cheerfully to Walk with Hypermedia
Together Cheerfully to Walk with HypermediaTogether Cheerfully to Walk with Hypermedia
Together Cheerfully to Walk with Hypermedia
 
JAX-RS. Developing RESTful APIs with Java
JAX-RS. Developing RESTful APIs with JavaJAX-RS. Developing RESTful APIs with Java
JAX-RS. Developing RESTful APIs with Java
 
Restful webservices
Restful webservicesRestful webservices
Restful webservices
 
REST and Resource Oriented Architecture - okcDG March 2008
REST and Resource Oriented Architecture - okcDG March 2008REST and Resource Oriented Architecture - okcDG March 2008
REST and Resource Oriented Architecture - okcDG March 2008
 
Old WP REST API, New Tricks
Old WP REST API, New TricksOld WP REST API, New Tricks
Old WP REST API, New Tricks
 
Hypermedia APIs and HATEOAS
Hypermedia APIs and HATEOASHypermedia APIs and HATEOAS
Hypermedia APIs and HATEOAS
 
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
David Gómez G. - Hypermedia APIs for headless platforms and Data Integration ...
 
Cdm mil-18 - hypermedia ap is for headless platforms and data integration
Cdm mil-18 - hypermedia ap is for headless platforms and data integrationCdm mil-18 - hypermedia ap is for headless platforms and data integration
Cdm mil-18 - hypermedia ap is for headless platforms and data integration
 
Modified REST Presentation
Modified REST PresentationModified REST Presentation
Modified REST Presentation
 
rest-api-basics.pptx
rest-api-basics.pptxrest-api-basics.pptx
rest-api-basics.pptx
 
SAP ODATA Overview & Guidelines
SAP ODATA Overview & GuidelinesSAP ODATA Overview & Guidelines
SAP ODATA Overview & Guidelines
 
Doing REST Right
Doing REST RightDoing REST Right
Doing REST Right
 
APITalkMeetupSharable
APITalkMeetupSharableAPITalkMeetupSharable
APITalkMeetupSharable
 
How RESTful Is Your REST?
How RESTful Is Your REST?How RESTful Is Your REST?
How RESTful Is Your REST?
 
Cqrs api v2
Cqrs api v2Cqrs api v2
Cqrs api v2
 
Design Summit - RESTful API Overview - John Hardy
Design Summit - RESTful API Overview - John HardyDesign Summit - RESTful API Overview - John Hardy
Design Summit - RESTful API Overview - John Hardy
 
Nuxeo JavaOne 2007
Nuxeo JavaOne 2007Nuxeo JavaOne 2007
Nuxeo JavaOne 2007
 
Web Apps for the Masses
Web Apps for the MassesWeb Apps for the Masses
Web Apps for the Masses
 
WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!
WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!
WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!
 

Recently uploaded

CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 

Recently uploaded (20)

CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 

Hypermedia APIs: The Rest of REST

  • 1. Chris Marinos presents: Hypermedia APIs: The Rest of REST
  • 2. The Agenda ❖ REST overview ❖ Hypermedia ❖ Affordances ❖ Demo
  • 3.
  • 4.
  • 5. Who has written or consumed a REST API?
  • 7. –Chris Marinos REST APIs are where you, like, follow HTTP and stuff
  • 8. Representational State Transfer (REST) is a software architecture style consisting of guidelines and best practices for creating scalable web services. REST is a coordinated set of constraints applied to the design of components in a distributed hypermedia system that can lead to a more performant and maintainable architecture.
  • 9. Representational State Transfer (REST) is a software architecture style consisting of guidelines and best practices for creating scalable web services. REST is a coordinated set of constraints applied to the design of components in a distributed hypermedia system that can lead to a more performant and maintainable architecture.
  • 10. REST is the architectural style of the internet
  • 11. REST Constraints ❖ Client-Server ❖ Stateless ❖ Cache ❖ Uniform Interface ❖ Layered System ❖ Code-On-Demand (optional)
  • 12. REST Benefits ❖ Client-Server -> reuse across clients ❖ Stateless -> scalability/reliability ❖ Cache -> performance ❖ Uniform Interface -> simplicity of interaction ❖ Layered System -> visibility ❖ Code-On-Demand (optional) -> extensibility of client
  • 14. –Roy Fielding “…if the engine of application state (and hence the API) is not being driven by hypertext, then it cannot be RESTful and cannot be a REST API. Period.”
  • 15. The Agenda ❖ REST overview ❖ Hypermedia ❖ Affordances ❖ Demo
  • 16. HATEOAS Hypertext as the Engine of Application State (also a horrible acronym)
  • 17. So what is hypermedia?
  • 18. Richardson Maturity Model Level 0: Pox Level 1: Resources Level 2: HTTP Verbs Level 3: Hypermedia Controls REST
  • 19. Level 0: POX POST /myservice/ { method: ‘get_customer’ customer_id: 1235 } POST /myservice/ <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap- encoding"> <soap:Body xmlns:m="http://www.example.org/stock"> <m:GetCustomer> <m:CustomerId>1234</m:CustomerId> </m:GetCustomer> </soap:Body> </soap:Envelope>
  • 20. Level 1: Resources POST /customer/ { method: ‘get_customer’, customer_id: 1234} POST /organization/ { method: ‘get_organization’, organization_id: 1234} POST /organization/ { method: ‘create_organization’, organization_id: 1234, name: ‘new name’ }
  • 21. Level 2: Verbs GET /organizations/ ———————— { organization_id: 1234 name: ‘Cool Stuff Inc.’ } POST /organizations/ { organization_id: 999 name: ‘My New Organization’ } GET /organizations/999 ———————— { organization_id: 999 name: ‘My New Organization’ }
  • 22. Level 3: Hypermedia GET /organizations/ <form name="input" method=“post" action=“/organizations/“> Name: <input type="text" name=“organization_name"> <input type="submit" value="Submit"> </form> POST /organizations/ { organization_id: 1234 name: ‘My RESTful Organization’ }
  • 23. The Agenda ❖ REST overview ❖ Hypermedia ❖ Affordances ❖ Demo
  • 24. “A REST API should be entered with no prior knowledge beyond the initial URI (bookmark) and set of standardized media types that are appropriate for the intended audience (i.e., expected to be understood by any client that might use the API)” –Roy Fielding
  • 26. State transitions over URL structure
  • 27. Hypermedia Benefits • API discoverability and documentation • Reuse of state transition logic across clients • Ease of client development • More flexibility for servers to evolve
  • 29. Collection+JSON { "collection" : { "version" : “1.0", "href" : “https://foo.com/api/“, "links" : […], "items" : […], "queries" : […], "template" : {…} } }
  • 30. Links "links" : [ { "href": “https://foo.com/api/organizations/", "rel": "organizations" }, { "href": “https://foo.com/api/customers/", "rel": "customers" }, ],
  • 31. Items "items": [ { "href": “https://foo.com/api/organizations/1/", "data": [ { "name": “organization_id”, "value": “my_org” } ], "links": [ { “href": “https://foo.com/api/organizations/1/customers“, "rel": "customers" }, ] } ]
  • 32. Queries "queries" : [ {"rel" : "search", "href" : “https://foo.com/api/customers/search”, "data" : [ {"name" : “last_name", "value" : ""} ] } ],
  • 33. Template "template" : { "data" : [ {"name" : “fist_name”, "value" : "", "prompt" : “First name”}, {"name" : “last_name”, "value" : "", "prompt" : “Last name"}, ] }
  • 34. The Agenda ❖ REST overview ❖ Hypermedia ❖ Affordances ❖ Demo
  • 36. Who has written or consumed a REST API?
  • 37. Questions? ❖ API Craft Google group/mailing list ❖ RESTful Web APIs (Richardson/Amundsen) ❖ Roy Fielding’s thesis/blog ❖ Hypermedia formats (HAL, Siren, Hydra, CJ, JSON-LD, UBER, etc.) ❖ API Craft conference in Detroit (http://apicraft.org/)

Editor's Notes

  1. Ask for questions! Don’t be offended if I suggest that we talk about it offline. (I ramble)
  2. http://commons.wikimedia.org/wiki/File:Roy_Fielding.jpg Know this guy?
  3. http://commons.wikimedia.org/wiki/File:Rembrandt_-_Moses_with_the_Ten_Commandments_-_Google_Art_Project.jpg Fielding presented constraints/definition for REST As usual with rules/manifestos, people didn’t quite agree
  4. Raise your hands… I bet everyone is right… just not the way you think Next, I have one simple question
  5. This was a harder question than I thought to answer
  6. My definition before I did my homework
  7. http://en.wikipedia.org/wiki/Representational_state_transfer wikipedia definition of REST (no wonder I couldn’t sum it up)
  8. Wait a second, what’s this?
  9. Massively distributed Highly scalable Extremely decoupled Low latency
  10. Hypermedia is a requirement for REST, HTTP isn’t Hypermedia is a core part of Fielding’s dissertation, HTTP is only mentioned indirectly For this talk, we’re going to focus on REST over HTTP, but that’s NOT a requirement
  11. http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven according to Roy, you need hypermedia
  12. Let’s get more concrete
  13. If Fielding is black and white about REST, Richardson’s model is shades of grey
  14. server is pushing down resource state alongside available transitions through the system think about google.com as an example
  15. http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven
  16. http://upload.wikimedia.org/wikipedia/en/0/01/Screenshot_of_Zork_running_on_Frotz_through_iTerm_2_on_Mac_OSX.png Who’s ever played a text adventure? Wasn’t it annoying trying to guess what the game wanted you to type? The web works in a similar way- both are basically state machines (though the web is massively distributed, lazily evaluated, etc.) Much easier if you tell the player what they’re able to do instead of having them guess (though maybe less fun)
  17. Without hypermedia, we agonize over URL structure. Trying to make life easier for clients? The thing is, clients don’t care about URLs, they care about state transition/manipulation.
  18. Lots of formats with different affordances- going to focus on CJ for this talk since it’s easy to grok, natural transition for CRUD thinking, one I’m most familiar with, etc.
  19. sort of… not a ton of perfect examples, but it seem to be coming along
  20. Has anyone browsed a web page? If so you’ve used a REST API. Apply the same concepts that made the web successful to your APIs and profit.