Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dan 1288 posts 3942 karma points c-trib
    Jan 24, 2024 @ 12:55
    Dan
    0

    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

  • Garðar Þorsteinsson 119 posts 566 karma points
    Jan 24, 2024 @ 13:09
    Garðar Þorsteinsson
    100

    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

  • Dan 1288 posts 3942 karma points c-trib
    Jan 24, 2024 @ 13:44
    Dan
    0

    Ah! I had read the docs a couple of times but somehow missed those fetch/filter/sort tabs * facepalm *. Thanks!

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies