How to use REST API to access the WCM artifacts in WebSphere Portal 8.5

This blog provides information on how to display Web Content artifacts by consuming REST API provided in IBM Web Content Manager 8.5. Application. Developers can use Representational State Transfer (REST) services to work with Web Content Manager and demonstrate it on the portal application. The REST service for Web Content Manager provides authoring access to content items and elements. The service follows the Atom Publication Protocol, and Atom feeds, and entries are accessible in XML (application/atom+xml) and JSON (application/json) format.
Getting Started with REST Service in WCM The REST service for Web Content Manager is a pool of web services that are yielding with the Atom Publishing Protocol. They offer access to web content, including versions and workflow states, through HTTP. The service is designed according to the REST architectural style. REST services mark it very easy to form interactive content that can be altered directly by site users. Responsive, integrated editing tools can be made by embedding HTML and JavaScript in web content components that bind to the REST service to display or update content asynchronously. HTTP makes integration with remote clients at ease than with traditional API. Web Content Manager Functions can be noticeable to remote systems without adding more server-side components like JSP, to access Java APIs. HTTP lets these services to work effortlessly with your set-up which includes proxy servers, firewall, and caches. To use the REST service, for Web Content Manager a client user be assigned the "user" role or greater in the WCM REST SERVICE virtual resource. All authentic users are assigned the "user" role by default.
REST service for WCM with Query Parameters The below URL is used to get the content item using REST service call inside the portal server applications.
http://host:port/wps/mycontenthandler/wcmrest/Content/uid

For instance content with uid can be re-claimed using the below URL
http://host:port/wps/mycontenthandler/wcmrest/Content/099c4494-b92f-4f0e-b5b9-77dfce266502

The below ATOM XML will be returned by the WCM server for the particular content
http://localhost/blog/wp-content/uploads/2015/08/xml1.png
There are numerous query factors defined by the WCM product to go over and retrieve the WCM artifacts (Authoring Template, Presentation Template, Library Component, Content and etc.). Please find few sample REST URL to get the necessary information from the WCM server. Application developers can leverage REST service calls in the portal theme on the showing the list content which are required for the logged-in user’s approval, content going to published today and etc. This will be more useful and interactive way to integrate WCM inside the portal server application. Also, the REST service provides the option to perform the CRUD (Create, Read, Update and Delete) operations on WCM artifacts and you can develop the Portlet applications to simulate the Authoring Portlet capabilities at some extent.

Leave a Reply