Oktopost
Approvals

Workflow Items

View and manage posts, messages and advocacy stories pending approval in your workflows.

Workflow items are posts, messages and advocacy stories that have been submitted for approval and are currently moving through your workflow steps. Use these endpoints to retrieve items pending approval, check their status in the workflow process, approve or reject items, and manage content moving through your approval pipeline.

Workflow items remain in the approval queue until all workflow steps are completed. Once approved, posts are ready for publishing and messages become available for scheduling.

List Items

List messages and posts in your workflows.

Parameters

ParamDefaultDescription
page0The current page
count20The number of results per page. From 1 to 1000 maximum.
stepId-

Optional. Return the items in this step only

workflowId-

Optional. Return the items in this workflow only

withHistory0Optional. If set to 1, return the history information for each item.
withAuthors0

Optional. If set to 1, an additional object under the key Authors is returned. This object will contain all of the users present in the CreatedBy field of each item.

withSteps0

Optional. If set to 1, all of the steps for the requested items are added to the response under Steps.

Example Request

curl -i https://api.oktopost.com/v2/workflow-item

Example Result

{
	"Result": true,
	"Total": 1,
	"Items": [
		{
			"Id": "cwi000000000000",
			"CreatedBy": "00A000000000001",
			"Status": "pending",
			"StepId": "cws000000000000",
			"WorkflowId": "cwf000000000000",
			"MessageId": "005000000000000"
		}
	],
	"Authors": {
		"00A000000000001": {
            "Id": "00A000000000001",
            "Created": "2020-09-03 11:10:27",
            "Name": "Other User",
            "Email": "other.user@oktopost.com"
        }
	},
	"Steps": {
		"cws000000000000": {
			"Id": "cws000000000000",
			"Created": "2020-09-03 11:28:48",
			"WorkflowId": "cwf000000000000",
			"Name": "Step 1",
			"MustBeApprovedByEveryone": false,
			"Approvers": [
				{
					"Id": "00A000000000000",
					"Created": "2020-09-03 11:28:48",
					"Name": "Main User",
					"Email": "user@oktopost.com"
				}
			]
		}
	}
}

Sending items to approval

Use this endpoint to send a message or post to approval. The entityId parameter can be either a Message or Post ID.

Example Request

curl -i http://api.oktopost.com/v2/workflow-item -X POST \
    -d entityId=005000000000000 \
    -d workflowId=cwf000000000000

Example Result

{
	"Result": true,
	"Data": {
		"Id": "cwi000000000000",
		"CreatedBy": "00Aeh4wb9by9whl",
		"Status": "pending",
		"StepId": "cws000000000000",
		"WorkflowId": "cwf000000000000",
		"MessageId": "005000000000000"
	}
}

Approving and rejecting items

Use this endpoint to approve or request revisions for items that are pending approval.

Parameters

ParamDefaultDescription
note-Add a text note to the approve or reject action
isApprove0Set to 1 to approve the item and to 0 to reject it
stepId-

Optional. If set, it must be equal to the current items' step in the approval process. If you pass a different step ID, then no changes will be made. We recommend that use it to avoid potential mistakes when calling this endpoint multiple times.

Example Request

curl -i https://api.oktopost.com/v2/workflow-item/005000000000000 -X POST \
    -d note="Looks good!!!" \
    -d isApprove=1 \ 
    -d stepId=cws000000000000

Example Result

{
	"Result": true,
	"Data": {
		"Id": "cwi000000000000",
		"CreatedBy": "00Aeh4wb9by9whl",
		"Status": "pending",
		"StepId": "cws000000000000",
		"WorkflowId": "cwf000000000000",
		"MessageId": "005000000000000"
	}
}

Removing items from the workflow

Removing posts and messages from the workflow will revert them to Drafts.

Example Request

curl -i https://api.oktopost.com/v2/workflow-item/005000000000000 -X DELETE

Example Result

{
	"Result": true
}