You can use REST API to create, update, read, delete a WCM content, site area and other item types. Rest API provides output in two formats : XML, JSON. By default, it renders in XML format. To render in JSON/XML format, you need to include the parameter mime-type=application/json or mime-type=application/xml in the URL.
This is a sample URL to read a content and output as a JSON format.
Here, 4437cb07-d412-4e2b-8e11-f15ab1768d8f is the UUID of content. You can find the UUID from WCM Authoring Portlet by editing the content and clicking "Show hidden fields". Then under Properties tab, you will get the UUID of item. If the content has some file elements, then the JSON will output the attachment as URL as shown below:
"name" : "Attachment1",
"lang" : "en",
"value" : "Attachment 1"
"type" : "FileComponent",
"type" : "application/vnd.ibm.wcm+xml",
"type" : "application/pdf",
"value" : "/wps/wcm/myconnect/fd821aca-c13c-4482-bb80-0557aab48dab/Platinum-Brochure.pdf?MOD=AJPERES"
For more information about Rest API, please refer documentation :
Rest API also provides Query Service. Using Query Service you can get the list of items under a site area, project, all items created by a template, etc. For more information, please refer the below link:
There are 5 predefined query components which comes OOTB in the latest WebSphere Portal 8.5 CF09. They are :
query-siteAreaContent (added in CF09)
multipleIdQuery (added in CF09)
To find the list of available services, use this Rest Api:
This returns the services supported in the product.
Here is a sample URL to get all the contents under a Site Area by using the service query-siteAreaContent. Here, parentid is the UUID of site area.
You can also see the parameters available for query service in the below link.