Defining sub-resources for your RESTful API

Article 10 in the series of “ Pragmatic decisions for your RESTful API”, this post talks about defining sub-resources in your RESTful API.

Defining your sub-resources: map your endpoint URLs

Some of your resources can be considered as sub-resources. For example, consider a support ticket with multiple comments. Let’s say you want to retrieve all of the comments for ticket #123.

You could define comments with their own endpoint, such as: