November Happy Hour will be moved to Thursday December 5th.

Clarification Needed on Content Delivery API V2 - Referencing Folders and Pages

Vote:
 

Hi,

We have successfully implemented Content Delivery API V2 in our application, and the API calls are functioning as expected. However, I seek clarification regarding referencing a folder versus a page.

In our observations, querying a reference to a folder only retrieves information about the folder itself and not its contents.Consequently, if our intention is to store a collection of assets in a folder and display them, it appears that we must include them on a page instead.

Could someone confirm this understanding or provide insights on an alternative approach?

Here's the API call that we are firing:

    https://examplesite.com/siteassets/images/***_photos_lib

    https://examplesite.com/siteassets/images/***_photos_lib?expand=* 

    Even with the "expand" parameter, the response is limited to just the folder itself, which is not the case when using "expand" to query a page.

    For additional context, here's a snapshot of our folder structure & the JSON response that is returned when querying:.

    JSON Response :

    [
      {
        "contentLink": {
          "id": 157558,
          "workId": 0,
          "guidValue": "fd060af6-545a-4c94-9575-7c9c46bd853d",
          "url": "/siteassets/images/***_photos_lib/?v=4939bf"
        },
        "name": "***_Photos_lib",
        "existingLanguages": [],
        "contentType": [
          "Folder",
          "SysContentFolder"
        ],
        "parentLink": {
          "id": 4956,
          "workId": 0,
          "guidValue": "a5fda262-55da-41d2-8ff3-0d045dbd439d",
          "url": "/siteassets/images/?v=4a3347"
        },
        "routeSegment": "***_photos_lib",
        "url": https://examplesite.com/siteassets/images/***_photos_lib/?v=4939bf,
        "changed": "2023-03-08T15:37:16Z",
        "created": "2023-03-08T15:37:16Z",
        "saved": "2023-03-08T15:37:30Z"
      }
    ]
    #314506
    Edited, Dec 21, 2023 9:29
    Vote:
     

    If you want to list the content in a folder, you need to load the children; https://examplesite.com/siteassets/images/***_photos_lib/children. Just like you list any content.

    #314566
    Dec 22, 2023 22:06
    Vote:
     
    Thank you, Johan, for your response. The solution you mentioned worked as expected.
    I do have a follow-up question if there's a nested folder structure as below.
    Library
       Image1
       Image2
       Sub Folder1
          Image1
       Sub Folder2
          Image1
    Is there a specific approach you recommend for handling such cases? Would it be preferable to use /children and make nested calls to retrieve the children of each level, or do you suggest an alternative strategy?
    Your insights on these aspects would be highly valuable. Thanks again for your help!
    #314639
    Dec 24, 2023 8:33
    This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
    * You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.