Nested includes
Last updated
Was this helpful?
Last updated
Was this helpful?
We ended the previous chapter with a small teaser about nested includes. Now in this part, we finally present to you the nested include. This tutorial will teach you what it is, where it is used and how you can apply them yourself.
The nested include allows you to further enrich your data by requesting more information from a standard include. Might sound difficult, but we assure you, it’s anything but hard. This is how we use nested includes.
For example, in our you’ve enriched your request with the participant
, and events
includes:
The include event shows you the data about players who received a card, scored a goal, or were substituted. A snippet of the response:
But what if we want to know more about the players, who scored a goal, like their country of origin, height, weight, age, image, etc? This is where the nested include comes into play!
The nested includes are represented in the form of dots (.), which are then linked to a standard include. This shows their relationship.
Because the include event is related to a player. You can add .player
to the include, which will result in the nested include: events.player
Now you've learnt how to enrich your response. However, as you might have noticed you also receive a set of data you're maybe not interested in.
In the next chapter, you will learn how you can filter and select specific fields of the response.