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

ヘッドレスAPIでサブフォルダーのウェブコンテンツが取得されない

written-by

Amit Tiwari

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

問題

再現するためのステップ
1. 3つの基本的なウェブコンテンツを作成する。
2. フォルダを作成し、その中に2つの基本的なウェブコンテンツを作成します。
これで、ウェブコンテンツは全部で5個になりました。
3. Navigated to http://localhost:8080/o/api
4. 以下のAPIでAPIリクエストを実行しました:
/o/headless-delivery/v1.0/sites/{siteid}/structured-contents

期待される動作
実際の動作です: フォルダーの外にあるウェブコンテンツを取得するのみで、カウントは3です。

Environment

  • Liferay DXP 7.4

解決策

  • サブフォルダー内のウェブコンテンツにアクセスするために、 "flatten=true"を追加してください。
    o/headless-delivery/v1.0/sites/20123/structured-contents?flatten=true

追加情報

did-this-article-resolve-your-issue

legacy-knowledge-base