Return whole site content with content delivery API in multi-site environment
Hi,
I have a multi-site Umbraco 13 environment. I'm looking to retrieve the whole content of "site 2" (including children/descendants) using the Content Delivery API. There are separate domain bindings for each site. Site 2 has the domain binding site2.example.com.
Return whole site content with content delivery API in multi-site environment
Hi,
I have a multi-site Umbraco 13 environment. I'm looking to retrieve the whole content of "site 2" (including children/descendants) using the Content Delivery API. There are separate domain bindings for each site. Site 2 has the domain binding
site2.example.com
.When doing this:
https://site2.example.com/umbraco/delivery/api/v1/content/
…it returns the whole content of site 1 and nothing from site 2.
When doing this:
https://site2.example.com/umbraco/delivery/api/v1/content/item/9fd419ea-a998-4af9-9b76-f645ea535f78?expand=all
…where the item id is the root node of site 2, it returns the data for that node but none of the child/descendant nodes.
Is it possible to return the full content structure from a given node? If so, how?
Thanks
Hi dan,
You would do it like this:
https://site2.example.com/umbraco/delivery/api/v1/content?fetch=descendants:9fd419ea-a998-4af9-9b76-f645ea535f78&expanded=all
You can read more about it in the documentation here: https://docs.umbraco.com/umbraco-cms/reference/content-delivery-api
Look under Query parameters and Fetch
Ah! I had read the docs a couple of times but somehow missed those fetch/filter/sort tabs * facepalm *. Thanks!
is working on a reply...