Issue
- How to access the entire document hierarchy page using API?
Environment
- All environments
Resolution
- By default, the GET Documents call in the Liferay API restricts access to the root page, preventing retrieval of the complete document hierarchy. To access the entire document hierarchy lies in incorporating the recursive=true parameter into the GET request for the /documents endpoint.
-
A possible example to achieve the desired behavior is to include the following API call:
GET /headless-delivery/v1.0/sites/{siteId}/documents?flatten=true&recursive=true
- Replace {siteId} with the ID of the desired site.
- The flatten=true parameter presents the documents in a flat structure, simplifying navigation.
- The recursive=true parameter ensures the query encompasses the entire folder hierarchy.
Additional Information
Conteúdo Excluesivo para Assinantes
Uma Subscrição do Liferay Enterprise fornece acesso a mais de 1.500 artigos que incluem práticas recomendadas, solução de problemas e outras soluções valiosas. Faça login para obter acesso completo.
Entrar