Copied to clipboard

Flag this post as spam?

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


  • Andreas Jacobsen 9 posts 60 karma points
    Jan 24, 2023 @ 21:48
    Andreas Jacobsen
    0

    Get all ancestors with Umbraco Heartcore

    I have a site with a bunch of nested data that I need to display on a single page. To do this I need to call many "pages" from one page. But trying using the REST API and Node client I can only get a max of 10 array results back. When querying "Inklud" shown in the image bellow I expect allot more than 10 results.

    Multiple levels of nested data structured after WCAG My query over REST is like this

    https://cdn.umbraco.io/content/<contentId>/descendants
    

    With Node client

    const audit= await client.delivery.content.ancestors.(<contentId>)
    

    Does anyone know how I can get all my results? I don't mind sharing login with Umbraco employees, but appreciate answers from everyone :)

  • Lindow 154 posts 1301 karma points
    Jan 24, 2023 @ 22:07
    Lindow
    100

    Hi Andreas

    I recommend reaching out to the support team as it looks like something that would require backoffice access to investigate properly.

    You should in fact get all of the screenshotted nodes returned in the API response.

    It's a good idea to check if an API client like Postman gets the same result.

    That way we can exclude this from being a mysterious issue with the SDK and rather one on your project or even a general one.

  • Lindow 154 posts 1301 karma points
    Jan 24, 2023 @ 22:09
    Lindow
    100

    Wait a sec. Just had a look at the docs and it looks like we have pagination for descendants. See here https://our.umbraco.com/Documentation/Umbraco-Heartcore/API-Documentation/Content-Delivery/content/#get-descendants

    Try with the params and see if you get more than 10 :)

  • Andreas Jacobsen 9 posts 60 karma points
    Feb 01, 2023 @ 10:08
    Andreas Jacobsen
    1

    This worked, fantastic! I just need to get better at reading the docs 😅

  • Lindow 154 posts 1301 karma points
    Feb 01, 2023 @ 10:23
    Lindow
    0

    Awesome to hear that! Enjoy the docs :)

Please Sign in or register to post replies

Write your reply to:

Draft