Including/resolving links using the sync API

I’m working on effectively mirroring the functionality of the node package by directly calling the API when initial sync happens. The Node package seems to “automagically” include all data and fields on an entry’s links anywhere a link may exist, instead of simply including the link’s ID. Is there a way to do this using the sync API? I tried adding &includes=10 to the query params to no avail.

Hi @julie.osborne,

The initial sync will, by default, retrieve all entries since the creation of the space alongside all available localizations, so it would not be necessary to add the include parameter to it (any linked items will already be retrieved in the response).

Does that make sense? How exactly are you thinking of using the Sync API, and why not use the Delivery API directly?


Mario, SDK developer from Contentful here. Sadly the api does not offer link resolution, as in resolving the links in an response with it’s objects linked to.

But luckily, that’s what SDKs are for. :slight_smile: You could take a look at the implementation on github and get inspired by it. The tricky part in implementing it, is to resolve circular links (a links b links c links a).

I’m curious to on what the use case for a reimplementing of the SDK is. Do you mind sharing why you want to mirror the SDK features? Maybe there is something we can improve upon.

Thanks for reaching out and I’m happy to discuss further…