The APIs are meant to be consumed and define how the API can be consumed. APIs specify the list of commands/operations as well as the format/schema of those commands that are required for interaction with the API.
When defining a REST API, the key abstraction of information is the resource. A resource is defined as a conceptual mapping to a set of entities. API design is centered around the resource that forms the nucleus of the design. Uniform Resource Identifier (URI), operations (using HTTP methods), and resource representations (JSON schema) are built keeping the resource in mind. It becomes very important to have the right abstraction of the resource to enable consumption, re-usability, and maintainability of the API.
The resource can point to a single entity or a collection of entities. For example, a product is a singular resource, whereas products are a collection of resources. We will cover the design guidelines at two levels:
- How to identify the right level of...