REST service for WCM V2 APIs
Use the Web Content Manager (WCM) REST V2 APIs to manage web content. The REST service for WCM provides authoring access to content items and elements.
The V2 APIs complete the available actions for content and other WCM artifacts. They were either developed from scratch or created to bring their corresponding REST service for WCM V1 APIs to the V2 Swagger interface. Most of the APIs introduced in the WCM REST V2 API explorer adhere to the same API path or URI fragment structure as the WCM V1 APIs.
For detailed information about V2 APIs, refer to the WCM REST V2 API documentation. For the WCM REST V1 version of the APIs, refer to How to manage web content items by using REST.
Differences between V1 and V2 APIs
-
The request URL and all links in the response body use
wcmrest-v2instead ofwcmrest. For example:# V1 API URL /wps/mycontenthandler/wcmrest/PresentationTemplate # V2 API URL /wps/mycontenthandler/wcmrest-v2/PresentationTemplate -
Request and response bodies use JSON exclusively. You do not need to add the
?mime-type=application/jsonquery parameter to get a JSON response, which was required for V1 APIs when the request body used XML. - The WCM REST V2 Swagger API explorer provides API descriptions, sample request values, and sample response codes.
WCM REST V2 API explorer
Developers using HCL DX WCM REST APIs can explore and test all the WCM V2 APIs by using the WCM REST V2 API explorer.
-
Access the API explorer at
http://<host>:<port>/dx/api/wcm/v2/explorer/orhttps://<host>:<port>/dx/api/wcm/v2/explorer/. For example:https://host:10039/dx/api/wcm/v2/explorer/ -
Go to the endpoint you want to test and select Try it out.
- Modify the Request body as needed and select Execute.
Cache headers for WCM REST V2
Configure a cache header for GET requests for unauthenticated users to improve performance and cacheability. To enable this feature, set the public.rest.cache.expiry property to a value for expiry. For example, set public.rest.cache.expiry=86400s to represent 24 hours.
Define and manage the cache options by adding or updating properties in the WCMConfigService.properties file using the Helm chart, as described in Updating DX Compose WebEngine properties using Helm values.