legacy-knowledge-base
公開されました Sep. 10, 2025

Can we retrieve the list of Collections/ContentSets' names using headless API?

written-by

David Simon

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

Issue

  • Using Liferay's headless-delivery API, it’s not possible to retrieve Collections' (referred as ContentSets in the API) names.
  • The user wants to retrieve the collection by its name. There is a similar feature for web contents, where it is possible to search over all content structures and filter by name, via this route:

    /o/headless-delivery/v1.0/sites/{0}/content-structures?filter="name eq ''{1}''"
  • There isn’t a similar route for content sets. The closest seems to be this one, which requires knowing the ID already:

    headless-delivery/v1.0/content-sets/{0}/content-set-elements
  • Basically, the user wishes the following route existed:

    headless-delivery/v1.0/content-sets/

Environment

  • Liferay DXP 7.0+

Resolution

  • The user has a workaround to use the collection's ID directly. However it has the below inconvenience:

    • It is environment-dependent. While the requested approach would allow them to define an environment variable with an identical value across all environments, here instead they will need to create the collection first in each environment, find out the ID, and define an environment variable that has no business meaning, and is different in each environment.

    • If their webmasters ever delete the collection, they will need to repeat the process again and redeploy their app.

    • A feature request is submitted to analyze a possible change in the future: LPD-42014. To track the status of the request, please inquire about it at Liferay Ask.
did-this-article-resolve-your-issue

legacy-knowledge-base