SlideShare a Scribd company logo
Documenting Hypermedia APIs
Nick Bradley - @NickJBradley
2© 2018 Worldpay, LLC and/or its affiliates. All rights reserved.
Starter
→ Brief introduction to Hypermedia
→ How it differs
Main Course
→ Why break the mould
→ Our API spec and docs
→ Outputs and assets
Dessert
→ What’s next
Today’s Menu
3© 2018 Worldpay, LLC and/or its affiliates. All rights reserved.
Triple H
(Not the wrestler)
Hypermedia REST Concept
HATEOAS
(Hypermedia as the
engine of application
state)
Architecture
HAL
(Hypertext
application language)
Hypermedia
convention
4© 2018 Worldpay, LLC and/or its affiliates. All rights reserved.
How it differs
”Traditional” REST vs HATEOAS
Resource
Resource
Resource
Resource
Resource
Resource
Resource
Resource
Resource
Resource
Resource
Resource Resource
Resource
Resource
Resource
5© 2018 Worldpay, LLC and/or its affiliates. All rights reserved.
Why a hypermedia API?
HATEOAS gonna hate
Payments lifecycle Discoverability
6© 2018 Worldpay, LLC and/or its affiliates. All rights reserved.
Spec'ing it out
Why not Open API
😪
😬
7© 2018 Worldpay, LLC and/or its affiliates. All rights reserved.
The documentation
Actions speak louder than URLs
→ API specification files for discoverability
→ API reference documentation – generated from API
specification files
→ API guide for more conceptual docs and education
8© 2018 Worldpay, LLC and/or its affiliates. All rights reserved.
Specification files
9© 2018 Worldpay, LLC and/or its affiliates. All rights reserved.
API Ref
→ Contents tree
→ Link relationships
→ Examples
10© 2018 Worldpay, LLC and/or its affiliates. All rights reserved.
The guide
11© 2018 Worldpay, LLC and/or its affiliates. All rights reserved.
Taking it further
Developer experience doesn’t grow on trees
12© 2018 Worldpay, LLC and/or its affiliates. All rights reserved.
Where next
Open source-me
Open-source spec
and UI
Sandbox/Playground
More interactive
assets
13© 2018 Worldpay, LLC and/or its affiliates. All rights reserved.
Takeaways
→ HATEOAS is not for everyone (but it works for us)
→ Discoverability helps ease the pain
→ Education is key
→ If you’re a little crazy, create your own spec
→ It’s all about actions and trees
© 2018 Worldpay, LLC and/or its affiliates. All rights reserved. Worldpay, the logo and any associated brand names are trademarks
or registered trademarks of Worldpay, LLC and/or its affiliates in the US, UK or other countries. All other trademarks are the property
of their respective owners.
Questions? (And thanks for listening)

More Related Content

Similar to Documenting Hypermedia APIs (20)

PPTX
Srishti
Hilary Ip
 
PDF
2012 BtoB Magazine Net Marketer Seminar "Wanting to buy from you"
Kevin Cox
 
PDF
Top Tips from Top RFP and Proposal Experts
Loopio RFP Software
 
PDF
2012 Converge "Wanting to buy from you" Institute of Search, Social and Mobil...
Kevin Cox
 
PPTX
Move and Secure Your Data
Delphix
 
PPT
Demystifying the Cloud: Can Procurement Really Benefit?
SAP Ariba
 
PDF
Talk to me Goose: Going beyond your regular Chatbot
Luc Bors
 
PDF
Nuevas oportunidades de negocio en turismo
OracleIberia
 
PDF
Learning from Art for Business Success
ageofartists
 
PDF
SAP Tech Innovation for Business - 2014.05
Vitaliy Rudnytskiy
 
PPTX
Hadoop User Group 29Jan2015 Apache Flink / Haven / CapGemnini REX
Modern Data Stack France
 
PDF
Contratos Inteligentes: passo-a-passo para criação
Fernando Galdino
 
PDF
Oracle Chatbot (챗봇) 솔루션
Mee Nam Lee
 
PDF
Machine Learning in easy pieces
Sakshi Ganeriwal
 
PDF
Shell Script 4 DBAs
Rodrigo Mufalani
 
PPTX
Logic apps101
Nathan Taylor
 
PDF
Public hyperledger meetup sf may 2018
Oracle Developers
 
PDF
Preventing Fraud and Building an End-to-End Data Science Hub at Feedzai with ...
Elasticsearch
 
PDF
Oracle Cloud World 2019 - Oracle Digital Assistant
Mee Nam Lee
 
PDF
Crafting enhanced customer experience through chatbots, beacons and oracle jet
Rohit Dhamija
 
Srishti
Hilary Ip
 
2012 BtoB Magazine Net Marketer Seminar "Wanting to buy from you"
Kevin Cox
 
Top Tips from Top RFP and Proposal Experts
Loopio RFP Software
 
2012 Converge "Wanting to buy from you" Institute of Search, Social and Mobil...
Kevin Cox
 
Move and Secure Your Data
Delphix
 
Demystifying the Cloud: Can Procurement Really Benefit?
SAP Ariba
 
Talk to me Goose: Going beyond your regular Chatbot
Luc Bors
 
Nuevas oportunidades de negocio en turismo
OracleIberia
 
Learning from Art for Business Success
ageofartists
 
SAP Tech Innovation for Business - 2014.05
Vitaliy Rudnytskiy
 
Hadoop User Group 29Jan2015 Apache Flink / Haven / CapGemnini REX
Modern Data Stack France
 
Contratos Inteligentes: passo-a-passo para criação
Fernando Galdino
 
Oracle Chatbot (챗봇) 솔루션
Mee Nam Lee
 
Machine Learning in easy pieces
Sakshi Ganeriwal
 
Shell Script 4 DBAs
Rodrigo Mufalani
 
Logic apps101
Nathan Taylor
 
Public hyperledger meetup sf may 2018
Oracle Developers
 
Preventing Fraud and Building an End-to-End Data Science Hub at Feedzai with ...
Elasticsearch
 
Oracle Cloud World 2019 - Oracle Digital Assistant
Mee Nam Lee
 
Crafting enhanced customer experience through chatbots, beacons and oracle jet
Rohit Dhamija
 

More from Pronovix (20)

PDF
By the time they're reading the docs, it's already too late
Pronovix
 
PPTX
Optimizing Dev Portals with Analytics and Feedback
Pronovix
 
PPTX
Success metrics when launching your first developer portal
Pronovix
 
PDF
Documentation, APIs & AI
Pronovix
 
PDF
Making sense of analytics for documentation pages
Pronovix
 
PPTX
Feedback cycles and their role in improving overall developer experiences
Pronovix
 
PDF
GraphQL Isn't An Excuse To Stop Writing Docs
Pronovix
 
PPTX
API Documentation For Web3
Pronovix
 
PDF
Why your API doesn’t solve my problem: A use case-driven API design
Pronovix
 
PDF
unREST among the docs
Pronovix
 
PDF
Developing a best-in-class deprecation policy for your APIs
Pronovix
 
PDF
Annotate, Automate & Educate: Driving generated OpenAPI docs to benefit everyone
Pronovix
 
PDF
What do developers do when it comes to understanding and using APIs?
Pronovix
 
PDF
Inclusive, Accessible Tech: Bias-Free Language in Code and Configurations
Pronovix
 
PDF
Creating API documentation for international communities
Pronovix
 
PDF
One Developer Portal to Document Them All
Pronovix
 
PDF
Docs-as-Code: Evolving the API Documentation Experience
Pronovix
 
PDF
Developer journey - make it easy for devs to love your product
Pronovix
 
PPTX
Complexity is not complicatedness
Pronovix
 
PDF
How cognitive biases and ranking can foster an ineffective architecture and d...
Pronovix
 
By the time they're reading the docs, it's already too late
Pronovix
 
Optimizing Dev Portals with Analytics and Feedback
Pronovix
 
Success metrics when launching your first developer portal
Pronovix
 
Documentation, APIs & AI
Pronovix
 
Making sense of analytics for documentation pages
Pronovix
 
Feedback cycles and their role in improving overall developer experiences
Pronovix
 
GraphQL Isn't An Excuse To Stop Writing Docs
Pronovix
 
API Documentation For Web3
Pronovix
 
Why your API doesn’t solve my problem: A use case-driven API design
Pronovix
 
unREST among the docs
Pronovix
 
Developing a best-in-class deprecation policy for your APIs
Pronovix
 
Annotate, Automate & Educate: Driving generated OpenAPI docs to benefit everyone
Pronovix
 
What do developers do when it comes to understanding and using APIs?
Pronovix
 
Inclusive, Accessible Tech: Bias-Free Language in Code and Configurations
Pronovix
 
Creating API documentation for international communities
Pronovix
 
One Developer Portal to Document Them All
Pronovix
 
Docs-as-Code: Evolving the API Documentation Experience
Pronovix
 
Developer journey - make it easy for devs to love your product
Pronovix
 
Complexity is not complicatedness
Pronovix
 
How cognitive biases and ranking can foster an ineffective architecture and d...
Pronovix
 
Ad

Recently uploaded (20)

PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
Digital Circuits, important subject in CS
contactparinay1
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Ad

Documenting Hypermedia APIs

  • 1. Documenting Hypermedia APIs Nick Bradley - @NickJBradley
  • 2. 2© 2018 Worldpay, LLC and/or its affiliates. All rights reserved. Starter → Brief introduction to Hypermedia → How it differs Main Course → Why break the mould → Our API spec and docs → Outputs and assets Dessert → What’s next Today’s Menu
  • 3. 3© 2018 Worldpay, LLC and/or its affiliates. All rights reserved. Triple H (Not the wrestler) Hypermedia REST Concept HATEOAS (Hypermedia as the engine of application state) Architecture HAL (Hypertext application language) Hypermedia convention
  • 4. 4© 2018 Worldpay, LLC and/or its affiliates. All rights reserved. How it differs ”Traditional” REST vs HATEOAS Resource Resource Resource Resource Resource Resource Resource Resource Resource Resource Resource Resource Resource Resource Resource Resource
  • 5. 5© 2018 Worldpay, LLC and/or its affiliates. All rights reserved. Why a hypermedia API? HATEOAS gonna hate Payments lifecycle Discoverability
  • 6. 6© 2018 Worldpay, LLC and/or its affiliates. All rights reserved. Spec'ing it out Why not Open API 😪 😬
  • 7. 7© 2018 Worldpay, LLC and/or its affiliates. All rights reserved. The documentation Actions speak louder than URLs → API specification files for discoverability → API reference documentation – generated from API specification files → API guide for more conceptual docs and education
  • 8. 8© 2018 Worldpay, LLC and/or its affiliates. All rights reserved. Specification files
  • 9. 9© 2018 Worldpay, LLC and/or its affiliates. All rights reserved. API Ref → Contents tree → Link relationships → Examples
  • 10. 10© 2018 Worldpay, LLC and/or its affiliates. All rights reserved. The guide
  • 11. 11© 2018 Worldpay, LLC and/or its affiliates. All rights reserved. Taking it further Developer experience doesn’t grow on trees
  • 12. 12© 2018 Worldpay, LLC and/or its affiliates. All rights reserved. Where next Open source-me Open-source spec and UI Sandbox/Playground More interactive assets
  • 13. 13© 2018 Worldpay, LLC and/or its affiliates. All rights reserved. Takeaways → HATEOAS is not for everyone (but it works for us) → Discoverability helps ease the pain → Education is key → If you’re a little crazy, create your own spec → It’s all about actions and trees
  • 14. © 2018 Worldpay, LLC and/or its affiliates. All rights reserved. Worldpay, the logo and any associated brand names are trademarks or registered trademarks of Worldpay, LLC and/or its affiliates in the US, UK or other countries. All other trademarks are the property of their respective owners. Questions? (And thanks for listening)

Editor's Notes

  • #2: Hi, I’m Nick, I’m in charge of API documentation and developer experience at Worldpay, I’m going to talk a little about how we’ve documented a new suite of hypermedia driven APIs. I touched on this very briefly at the previous API the docs conference in Paris in a short cameo but I’ll try and explain a little more today.
  • #3: I’ll start by giving a brief introduction to hypermedia and hateoas. Just out of interest, can I get a quick show of hands who has worked with hypermedia driven APIs. I’ll try and keep it fairly high-level. Feel free to grab me afterwards if you need a little more detail. I’ll then run through why, at Worldpay we decided to go with hypermedia, before digging in to our documentation and some more visual assets we have built. Finally I’ll touch on where we want to go next and some areas we want to focus on for improvement. I’ll try and avoid starting too much of a debate on API design, we think this works for us but it will not be for everyone.
  • #4: Hypermedia Sooo…hypermedia. This is actually a fairly prevalent concept within REST APIs. Hypermedia generally refers to anything that isn’t simply hypertext, this could be images, video, graphics etc. In this context we will talk about in terms of hyperlinks. HATEOAS HATEOAS, or hypermedia as the engine of application state is essentially a system that is driven by hypermedia. This allows the consumer to manage state using hypermedia links returned in responses. I’ll talk a little bit more about how this works for us in my next slide. HAL HAL, or Hypertext application language is a convention that we use to standardize all the responses. This ensures the client will always be able to consume the hypermedia links in the same way.
  • #5: So he’s a couple of diagrams designed to give a VERY SIMPLE view of the differences between a more traditional REST API and a hypermedia driven API. With REST you can see that all resources are considered equal. You can make requests to any of the resources at any time because all of the URLs are known to you. This means that it is stateless. With a hypermedia driven API, you can see that the state is managed through the links. The only URL you need to be aware of is the URL for the root resource (the one furthest left). The URLs for the ‘twigs’ on the right of the diagram are not known up front, these are ALL generated dynamically. In order to access those resources, you’ll need to use the hypermedia link returned to you by the API. This means that we could change these URLs at any time if we wanted to. Instead of thinking about these resources as URLs we prefer to think about them as actions, you need only know what your next action is and the API will handle the URLs dynamically for you.
  • #6: So why did we decide to go with a hypermedia driven API at Worldpay? Firstly from a payments perspective the lifecycle of a payment is very much suited to this. In the past with a more traditional approach, we could receive lots of “invalid” requests as the state of a payment was not managed by the system. I say invalid as from the clients perspective this is a valid request. For us this could cause issues downstream and also result in unexpected behavior for the client. Let’s take a simple payment as an example. This is very much a distilled down version of what goes by the way. The first step is to authorize the funds, the next step is to settle and, if there’s an issue with the product you might need refund the payment. Obviously, it would be silly to attempt to refund a payment before it’s even been made, so we just don’t give you a URL for that. The only way to do that is with the encoded link returned to you once you’ve settled the funds. Once that payment cycle is complete, you go back round to that start and through the process again, those URLs you had earlier are no longer required, you need to go and generate some new ones by creating a new payment. The other reason for hypermedia is the notion of discoverability, the client can navigate their way through and discover their next actions by taking a look at the links in the responses. This is a little alien for us when it comes to docs, as we’re used to providing everything up front. It helps ease that barrier of entry and hopefully reduces a bit of complexity. Data showed lots of incorrect requests – bad Can’t refund a payment that doesn’t exist. Therefore not provided with the refund URL Discoverability helps to map out flows of requests Better alignment for dev teams
  • #7: Right, on to the actual documentation! It’s pretty standard nowadays to use an API specification to support documentation and other assets. Unfortunately for us OpenAPI doesn’t yet support a fully hypermedia driven API. It’s much more suited to the more static API design and doesn’t support URLs that are generated dynamically. This made me sad, I’ve been a big supporter of the swagger/open API and I’m very much bought in to all the value it brings. So what did we to solve this? Well we just decided we would create our own spec… Yes we are a little bit mad but for us there’s so much value in having that API spec, we’ve actually used it to rapidly design future APIs we like to be spec first. We have lots of different development teams working on lots of different APIs so it really helps to keep them all aligned. We make them responsible for keeping them up to date and we hope to start automating the generation of parts of the specifications.
  • #8: Okay, what have we actually produced by way of documentation? As mentioned, we’ve created our own specification files which are linked to by the API, as per the hal specification and they can be browsed and downloaded. We’ve used these to generate our API reference docs and we have a more traditional user guide to run through concepts and to help educate our developers around best practices for integration
  • #9: The specification for our APIs is made up of a number of json files. One for each resource in fact. The first and arguably the most important is our resource tree. This defines how the resources are linked together. This shows there’s multiple ways to navigate through the requests. Each API has this resource tree and it provides links to all of the relevant specification files for that API too, which is what makes it discoverable from within the browser. The next is an example of one of these resource specific files. These files contain everything we believe the developer needs to be aware of to perform that ”action”. For example it contains all the available http methods, the request and response schemas, all the parameters and requirements and also a set of examples, both request and response. This could be happy path or could involve an error scenario. Most importantly though, they highlight the rels or ”actions” that can be performed as a result of the original action. We really want our developers to think in terms of actions not endpoints.
  • #10: Our API ref (which you can see a little example of is entirely generated from the specification files I just showed you. The contents ‘’tree’ on the left is comprised of all the individual API resource trees. We define some yaml config on our developer portal for each of these and the UI generate the relevant links. The link relationships you can see are what I mentioned previously and allow the user to discover and click through the docs for the available next actions. The right hand pane is used to display the code from our examples. By selecting an example from the middle this will populate the right hand side and allow you to run through some scenarios.
  • #11: Our main API guide is very much focused around the concepts and use cases. We’re aware that integration of hypermedia driven APIs is done a little differently and so we want to use the guide to try and educate and ensure the integrator follows the right principles and best practices and also to help our developers understand why they are performing actions at certain stages. For us one of the key principles to get across is to avoid hardcoding the URLs. As I mentioned before the only URLs you need to be aware of are the API root resources so want to make sure our docs make that clear. We’d like to start fleshing the guide out a lot more as the product matures. We want to make it easier to drop in and grab a code snippet or have short tutorials to help somebody achieve a quick win.
  • #12: Beyond the documentation, we figured that now we have these specifications we should put them to good use. We can’t make use of the great ecosystem that OpenAPI has so lets focus on something that will help visualize our APIs and the notion that each of them acts very much like a tree. We use our resource trees to generate the above diagram. As you can see, we have a handful of scenarios and the tree updates to show the flow of requests to achieve that. Going back to our refund example, this is one of the final actions and only performed once 3 previous requests have been made.
  • #13: So where do we go next. We have our resourceTrees and our specs so we want to use them to generate more interactive assets. We have our API reference but we need to make it more interactive and so we’re working on bringing sandbox functionality. And finally we want to look at how we can begin to open-source some of what we’ve done. Making our spec available for everyone, this probably a fair way off at the moment however.
  • #14: To recap, HATEOAS is definitely not for everyone but it works well for us. Discoverability can help ease some of the pain and burden on the docs When it comes to hypermedia driven APIs it’s important to educate and guide people to the best practices And yeah it’s all about trees, we love them.
  • #15: Thanks you so much for listening.