-
Notifications
You must be signed in to change notification settings - Fork 0
Basic Concepts
The term REST is a tricky one. Without going into details, it has been misunderstood and used to represent many different things, solidifying over the years into something different than originally intended.
The Wepow API can be considered "RESTful"-ish. If you've worked with APIs that model state as resources, and use HTTP verbs to denote actions on said resources, you won't find much difference. We only add one more constraint, which is HATEOAS.
HATEOAS, or Hypertext As The Engine of Application State, can be understood as following: to traverse the application, links which signal the resources' relationships must be followed.
In other APIs, you will find a list of URIs with their corresponding resources. Here, the only URI that you need is the root, which will show you all the available resources and their respective URIs.
In short: URIs will always be provided to you by the service. They can change, but as long as you consume them from the service, everything will work transparently.
The Wepow API serves the JSON variant of HAL (application/hal+json). Since JSON has no native semantics for linking, we have decided to use the HAL media type to extend it. At the time of this writing, HAL is in the eighth version of its draft, against which we validate our responses.
Links may be templated, which means they are a URI Template (RFC6570) and must be processed before following them. There are plenty of libraries that make this straightforward, so be sure to look into the Developer Resources section.