Streaming live at 10am (PST)

Full definition of multiref object missing


#1

The JSON returned by the CMS API does not include the full definition of a multi-reference object. It only returns the ID. This then requires separate API calls for each sub item. I would also expect this work on multiple levels i.e. multiref items which link to multiref items.

My data structure: Books > Chapters > Notes. I would expect to query the Books Collection and have all nested objects returned in a single JSON response.

As emailed @cyberdave


#2

hey mwright

So the API does have (currently un-documented) support for single level item reference expansion, but it currently will not do nested expansions and multiple API calls will be necessary for that.

I've created an issue to update the actual docs to include this info, but if you want to play around with it in the meantime, the fetch items endpoint supports an additional parameter expand which expects an array of the fields you want expanded.

So with the example here: https://developers.webflow.com/?shell#get-all-items-for-a-collection, the updated request to expand a field books would be: https://api.webflow.com/collections/580e63fc8c9a982ac9b8b745/items?expand[]=books

Is that useful for your use case?

Let me know if you have any questions!


#3

Hi Nathan,

This is super helpful. It massively reduces my number of API calls. And it
reduces the amount of code needed to parse it. It would be great if nested
expansions were possible as I could throw away even more code!

Thanks
Martin