Designing the relationships between resources in your RESTful API

Article 9 in the series of “ Pragmatic decisions for your RESTful API”, this post talks about designing relationships between resources in your RESTful API.

Defining your relations: embed your fields based on query parameters

This is a tricky question. Should you display your relations directly in your resources or not ? Let’s take for example a list of messages shown in a RESTful API in the following way: