I am trying to submit a WCM REST call to restart the workflow of a published item. I am following this link from the Knowledge Center:
http://www.ibm.com/support/knowledgecenter/en/SSHRKX_8.5.0/mp/wcm/wcm_rest_crud_workflow.html
I submit a POST request like this:
http://host:port/wps/mycontenthandler/wcmrest/item/item-uuid/restart
with the following headers:
Accept: application/atom+xml
Content-Type: application/atom+xml
But I keep getting a 415 Unsupported Media Type response.
<errors>
<message code="UNSUPPORTED_MEDIA_TYPE_FOR_URI_1" xml:lang="en" text="The specified "Accept" or "Content-Type" values are not supported by the resource at URI wcmrest:item/dcdbc2e1-f34e-400b-802a-8296677e95c8/restart"/>
</errors>
This was working in Portal 8.0 but does not work in Portal 8.5.
Any ideas on how to fix this?
Answer by David A Batres (2799) | Jun 30, 2016 at 05:15 PM
The error suggests the Accept or Content-Type headers you are passing in are not supported for the WCM REST call.
See the following link for supported media types: http://www.ibm.com/support/knowledgecenter/en/SSHRKX_8.5.0/mp/wcm/wcm_rest_media_types.html
Checking with WCM development, they confirmed additional validation checks were added in Portal 8.5 to the REST service. For the restart workflow action, no data is expected with the POST request.
Solution would be to set the Content-Type to text/plain as the POST request does not expect any actual XML or HTML data. Above page will be updated to reflect the correct supported media types.
How to upload a file to a WCM component using REST API? 2 Answers
WCM API Sample Code to delete or purge expired WCM items 1 Answer
WCM API Sample Code to retrieve text from content text elements 1 Answer
Get " unhandled exception " errors running custom Portal Application 1 Answer
Why does WCM API getCurrentApprovers method return approvers for prior stage ? 1 Answer