Legacy Knowledge Base
Published Jun. 30, 2025

Getting a web content in scheduled status using the headless rest API

Written By

Jorge Diaz

How To articles are not official guidelines or officially supporteddocumentation. They are community-contributed content and may not alwaysreflect the latest updates to Liferay DXP. We welcome your feedback toimprove How to articles!

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

Legacy Article

You are viewing an article from our legacy "FastTrack"publication program, made available for informational purposes. Articlesin this program were published without a requirement for independentediting or verification and are provided "as is" withoutguarantee.

Before using any information from this article, independently verify itssuitability for your situation and project.

Issue

We are using the Liferay Headless API method getContentStructureStructuredContentsPage of  headless-delivery

  • /o/headless-delivery/v1.0/content-structures/<structure-id>/structured-contents

To get a web content filtering by a custom field of the structure:

  • contentStructureId: <id from DDMStucture>

  • filter: contentFields/my_custom_field eq 'value'

The problem with this API method is it only returns web contents that are in approved status, so you cannot get the web contents that are in scheduled status.

How can we get the information of a web content that is in scheduled status?

Environment

  • DXP 7.4
  • Liferay 2024.Q1
  • Quarterly Releases

Resolution

The API method getContentStructureStructuredContentsPage of  headless-delivery only returns the web contents that are in approved status by design, so you cannot use this API to get the required information.

To get the draft and scheduled versions of a web content, you can use the API method getSiteStructuredContentsPage of headless-admin-content:

  • /o/headless-admin-content/v1.0/sites/<group-id>/structured-contents

To get information about this API go to: http://localhost:8080/o/api?endpoint=http://localhost:8080/o/headless-admin-content/v1.0/openapi.json, or after opening the API Explorer, select "headless-admin-content/v1.0" in the REST application dropdown.

However, using this API is not possible to filter by a specific field. This was requested as a feature request, for more information see: LPD-35385

As an alternative, you could set up a search blueprint to execute the search by a specific field and then  use the search headless API to execute the search, for more information on this approach, see: How to set up Search Blueprints to be used with Search headless API

 

Additional Information

 

Did this article resolve your issue ?

Legacy Knowledge Base