ContentWorkflowResources Resource

Content workflows information and operations as:

  • get workflow status
  • approvals: approve, reject, assign, unassign
  • change state
  • change expiry date
  • change page workflow parameters

IMPORTANT NOTICE

All paths defined here must be preceded by the app's REST endpoint base path: rest/cw/1

PATCH /content/{id}/expirydate

Changes the expiration date for the current state in a page.

Requires the edit page permission and current state to allow due dates to be changed.

Request Parameters
name type description default
id path id of the page n/a
admin query admin mode, returns all actions executable by space admin n/a
expand query [state, states, approvals, actions, tasks] which parts of the workflow response to expand in the response. n/a
Request Body
media type data type description
application/json ContentWorkflowStateExpirationOperation (JSON) State request with the "expiry" attribute filled with date in millis, not specifying the attribute or setting it to null will remove the expiration date
Response Codes
code condition
200 Workflow status.
400 There was an error in request. The detail of the error will be provided as messages.
401 If client is not authenticated
403 If no View permission on the page.
404 If no valid page with such id.
Response Body
media type data type description
application/json ContentWorkflowResponse (JSON) Representation of the workflow status

GET /content/{id}/parameters

Get the workflow parameters list that can be edited in a page.

Requires the user to have edit page permission.

Request Parameters
name type description default
id path the id of the page n/a
Response Codes
code condition
200 Page Editable Workflow Parameters
204 There are no editable workflow parameters in the page
401 If client is not authenticated
403 If no edit page permission
404 If no valid page with such id or no view permission on the page.
Response Body
media type data type description
application/json WorkflowParametersResponse (JSON) List of workflow parameters of the page that can be edited

PUT /content/{id}/parameters

Update the workflow parameters on a page.

Requires the user to have edit page permission.

Request Parameters
name type description default
id path the id of the page n/a
expand query the expansions on the response object [state, states, approvals, actions, tasks] n/a
Request Body
media type data type description
application/json map of string (JSON)

a map of parameter Id and new value to update.

Example: {"param0001":"newValue1","param0002":"newValue2"}

Response Codes
code condition
200 Workflow status.
400 There was an error in request. The detail of the error will be provided as messages.
401 If client is not authenticated
403 If no edit page permission
404 If no valid page with such id or no view permission on the page.
Response Body
media type data type description
application/json ContentWorkflowResponse (JSON) Workflow status with requested expansions

PUT /content/{id}/state

Changes the workflow state on a page

Requires edit page permission

Request Parameters
name type description default
id path id of the page n/a
admin query admin mode, returns all actions executable by space admin n/a
expand query [state, states, approvals, actions, tasks] which parts of the workflow response to expand in the response. n/a
Request Body
media type data type description
application/json ContentWorkflowStateOperation (JSON) State request with the info to change state: its mandatory to specify a valid state name
Response Codes
code condition
200 Workflow status.
400 There was an error in request. The detail of the error will be provided as messages.
401 If client is not authenticated
403 If no View permission on the page.
404 If no valid page with such id.
Response Body
media type data type description
application/json ContentWorkflowResponse (JSON) Representation of the workflow status

GET /content/{id}/status

Returns expandable information regarding the workflow status, allowing the client to expand the required information.

Requires view page permission

Request Parameters
name type description default
id path id of the page n/a
admin query admin mode, returns all actions executable by space admin n/a
expand query [state, states, approvals, actions, tasks] which parts of the workflow response to expand in the response. n/a
publishedView query if true, public view specific info, like public view messages, are retrieved n/a
Response Codes
code condition
200 Workflow status.
204 If there is no workflow set on the page
400 Workflow error. Check messages
401 If client is not authenticated
403 If no View permission on the page.
404 If no valid page with such id.
Response Body
media type data type description
application/json ContentWorkflowResponse (JSON) Representation of the workflow status

PATCH /content/{id}/approvals/approve

Approve an approval on a page

Requires view page permission

Request Parameters
name type description default
id path id of the page n/a
expand query [state, states, approvals, actions, tasks] which parts of the workflow response to expand in the response. n/a
Request Body
media type data type description
application/json ContentWorkflowApprovalOperation (JSON) Approval request with all the info needed to approve the approval: name of the approval is required, user and password are only required when the approval requests credentials, and comment is optional by default (can be changed in the configuration)
Response Codes
code condition
200 Workflow status.
400 There was an error in request, such as bad credentials when required, etc. The detail of the error will be provided as messages
401 If client is not authenticated
403 If no View permission on the page.
404 If no valid page with such id.
Response Body
media type data type description
application/json ContentWorkflowResponse (JSON) Representation of the workflow status

PATCH /content/{id}/approvals/assign

Assign a user to an approval

Requires view page permission

Request Parameters
name type description default
id path id of the page n/a
expand query [state, states, approvals, actions, tasks] which parts of the workflow response to expand in the response. n/a
Request Body
media type data type description
application/json ContentWorkflowApprovalAssignmentOperation (JSON) Assignation request with all the info needed: it's mandatory to specify approval name and assignee while comment is optional
Response Codes
code condition
200 Workflow status.
400 There was an error in request. The detail of the error will be provided as messages.
401 If client is not authenticated
403 If no View permission on the page.
404 If no valid page with such id.
Response Body
media type data type description
application/json ContentWorkflowResponse (JSON) Representation of the workflow status

PATCH /content/{id}/approvals/reject

Reject and approval on a page

Requires view page permission

Request Parameters
name type description default
id path id of the page n/a
expand query [state, states, approvals, actions, tasks] which parts of the workflow response to expand in the response. n/a
Request Body
media type data type description
application/json ContentWorkflowApprovalOperation (JSON) Rejection request with all the info needed to reject the approval: name of the approval is required, user and password are only required when the approval requests credentials, and comment is optional by default (can be changed in the configuration)
Response Codes
code condition
200 Workflow status.
400 There was an error in request, such as bad credentials when required, etc. The detail of the error will be provided as messages
401 If client is not authenticated
403 If no View permission on the page.
404 If no valid page with such id.
Response Body
media type data type description
application/json ContentWorkflowResponse (JSON) Representation of the workflow status

PATCH /content/{id}/approvals/unassign

Unassign a user from an approval

Requires view page permission

Request Parameters
name type description default
id path id of the page n/a
expand query [state, states, approvals, actions, tasks] which parts of the workflow response to expand in the response. n/a
Request Body
media type data type description
application/json ContentWorkflowApprovalAssignmentOperation (JSON) Unassign request with all the info needed: it's mandatory to specify approval name and assignee while comment is optional
Response Codes
code condition
200 Workflow status.
400 There was an error in request. The detail of the error will be provided as messages.
401 If client is not authenticated
403 If no View permission on the page.
404 If no valid page with such id.
Response Body
media type data type description
application/json ContentWorkflowResponse (JSON) Representation of the workflow status