As you have come to know that REST is just a requirement or additional constraint which gives us a specific approach to implement our required web services and do not require any hard-coded documentation. So, how can you recognize or determine; whether the API that you have built up is completely RESTful or not? This is why the Richardson Maturity Model came into existence that is typically referred for analyzing how much RESTful your API is.
What is the Richardson Maturity Model?
Richardson maturity model is a popular model used to rank your API based on the checks correlated to REST. The more your API fulfills the checks and constraints the more RESTful your API is for development and deployment. This special model has four stages which are called levels and the levels range from 0 to 3. If your API is in Level 0, it means your API is not at all RESTful, and on the other hand of your API is on Level 3, then it can be said that your API if fully RESTful and completing all the constraints of RESTfulness. Let us see what each level holds inexact:
In this stage, your API will employ only a single URI for exposing the entire API.
Moreover, usually, it employs only one a single HTTP method for fetching the resources. For example, if you take an API of employee registration, you can see that each of the resource associated with your API has its individual URI. The employee resource has a separate URI; the designation resource has its own as well as the employee-registration resource holds a separate URI.
The second level possesses its own URI for all of its resources. Moreover, level 1 employs several URIs which leads to a specific resource and each URI acts as an entry point. The only POST method is used for the operation.
This level suggests that your API must employ the properties of the protocol as greatly as feasible. Other than using a particular POST method for performing different operations, developers must implement the GET method also to request a resource. Also, for deleting a resource, the DELETE method needs to be implemented.
According to this level, your API must implement the concept of HATEOAS. Your response must include a logical link(s) for the resources that your API is having.
Let's consider the scenario of a case where the client demands the employee's information in which the employee's name is Alex; then the response should possess a logical link containing the URI of all employees that are registered to that company by that name.