You can use the REST services for Web Content Manager to create drafts, approve items in a workflow, and move items through different stages of a workflow.
The workflow features of the REST services for Web Content Manager can be used with the following item types:
| Item type | API type |
|---|---|
| Text component | LibraryTextComponent |
| Short text component | LibraryShortTextComponent |
| Rich text component | LibraryRichTextComponent |
| HTML Component | LibraryHTMLComponent |
| Number component | LibraryNumericComponent |
| Date and time component | LibraryDateComponent |
| Image component | LibraryImageComponent |
| File resource component | LibraryFileComponent |
| Content item | Content |
| Site Area | SiteArea |
| Managed Page | PortalPage |
You can create a draft of items that do not use workflows.
To do that, specify explicitly the draft workflow state in the request entry data. For example, to create a link component as draft:
HTTP/1.1 POST
http://host:port/wps/mycontenthandler/wcmrest/LibraryLinkComponent
<atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:wcm="wcm/namespace">
<wcm:name>linkDraft_E</wcm:name>
<atom:link atom:rel="library" atom:href="/wps/mycontenthandler/!ut/p/wcmrest/item/d07f0a12-3801-465e-bc20-eaec2cecf5cb"/>
<category label="Draft" scheme="wcmrest:workflowState" term="DRAFT"/>
</atom:entry>
201 Created
You can use the REST service to create a new draft item. This is equivalent to using the Create Draft button in the authoring portlet.
/item/item-uuid/create-draft
For example:
HTTP/1.1 POST http://host:port/wps/mycontenthandler/wcmrest/item/item-uuid/create-draft 201 Created
You can use the REST service to move an item to the next stage of a workflow. This is equivalent to using the Next Stage button in the authoring portlet.
/item/item-uuid/next-stage
For example:
HTTP/1.1 POST http://host:port/wps/mycontenthandler/wcmrest/item/<item-uuid>/next-stage 201 Created
You can use the REST service to move an item to the previous stage of a workflow. This is equivalent to using the Previous Stage button in the authoring portlet.
/item/item-uuid/previous-stage
For example:
HTTP/1.1 POST http://host:port/wps/mycontenthandler/wcmrest/item/item-uuid/previous-stage 201 Created
You can use the REST service to move an item to the next stage of a workflow by approving it. This is equivalent to using the Approve button in the authoring portlet.
/item/item-uuid/approve
For example:
HTTP/1.1 POST http://host:port/wps/mycontenthandler/wcmrest/item/item-uuid/approve 201 Created
You can use the REST service to reject an item in a workflow. This is equivalent to using the Reject button in the authoring portlet.
/item/item-uuid/reject
For example:
HTTP/1.1 POST http://host:port/wps/mycontenthandler/wcmrest/item/item-uuid/reject 201 Created
You can use the REST service to restart a workflow. This is equivalent to using the Restart button in the authoring portlet.
/item/item-uuid/restart
For example:
HTTP/1.1 POST http://host:port/wps/mycontenthandler/wcmrest/item/item-uuid/restart 201 Created