Best practices when designing resources
The following section highlights some of the best practices when designing RESTful resources:
- The API developer should use nouns to understand and navigate through resources and verbs with the HTTP method, for example, the /user/1234/books is better than /user/1234/getBook URI.
- Use associations in the URIs to identify subresources. For example, to get the authors for book 5678, for user 1234, use the following
- For specific variations, use query parameters. For example, to get all the books with 10 reviews, use
- Allow partial responses as part of query parameters if possible. An example of this case is to get only the name and age of a user, ...