What is HATEOAS APIs ?

This, in simple terms, is what the famous hypermedia as the engine of application state or HATEOAS constraint is all about. We see it in action every day on the Web, when we
follow the links to other pages within our browsers.

The purpose of HATEOAS is: Use HATEOAS to enable navigation to related resources

As you can see the response for account that also include URI to related resources like: deposit, withdraw, transfer and close.

So if we applying HATEOAS, the consumer API will call APIs like discovering and navigating to whatever they want in flow of transitioning of resources. This great !!!

In 2008, Leonard Richardson proposed the following maturity model for web APIs:

  • Level 0: Define one URI, and all operations are POST requests to this URI.
  • Level 1: Create separate URIs for individual resources.
  • Level 2: Use HTTP methods to define operations on resources.
  • Level 3: Use hypermedia (HATEOAS, described below).

Level 3 corresponds to a truly RESTful API according to Fielding’s definition. In practice, many published web APIs fall somewhere around level 2.

Please keep HATEOAS for your APIs.

%d bloggers like this: