Uploaded image for project: 'Confluence Cloud'
  1. Confluence Cloud
  2. CONFCLOUD-76008

Get pages from space method of REST API v2 missing depth parameter

    XMLWordPrintable

Details

    Description

      Issue Summary

      The v2 API endpoint to fetch pages on a space does not allow defining the depth of pages to be returned:

      This was possible on the equivalent endpoint from the API v1 as can be seen here:

      The parameter is useful when just the first level of pages in the hierarchy is needed, especially when a specific home page is not defined.

      This is reproducible on Data Center: no

      Steps to Reproduce

      1. Use the Get pages in space v2 API endpoint to retrieve pages on a space

      Expected Results

      It should be possible to filter the results based on the depth of pages similar to what the API v1 offered.

      Actual Results

      All pages are returned, there is no option for filtering by depth.

      Workaround

      If you need to retrieve only the root level of the page hierarchy, use the following logic with API v2:

      1. Retrieve all pages from the space using the endpoint:
      2. Find the home page by searching on that output for a page with parentId = null
      3. To find the first level pages below the home, search for pages that have parentId = <HomePageID>

      Alternatively, continue using the API v1 as it is still available until the end of the deprecation period.

      Note: Opening this as a bug instead of a feature request since the old API is deprecated and there is no direct equivalent for that use case on v2. The workaround involves multiple separate requests to achieve the same results provided by a single request of version 1.

      Attachments

        Activity

          People

            25652ccd84fa Simon Kliewer
            bandreeti Bernardo Andreeti
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: