API ReferenceContent

Workflows

Content workflows: their steps, the approvals a revision branch collects, and comments on a branch.

About workflows

A workflow takes a draft through steps, such as draft, review and approved, before it goes live. Changes are made on a revision branch, which moves from step to step. A transition can require approval from one or more groups; each group’s sign-off is a branch approval. Reaching the last step is what makes the branch’s newest revision live, and moving a branch back a step clears its approvals. Reviewers leave comments on a branch, as remarks or as tasks to resolve, optionally pinned to a place on the page.

Workflows themselves, and moving a branch between steps, are managed in the admin. The API reads workflows and manages approvals and comments.

Approvals Per group

A transition can name groups whose approval it needs; an approval records one group’s sign-off.

Revisions, publishing and approval
Going live At the last step

The branch’s newest revision goes live when it reaches the workflow’s last step.

Revisions, publishing and approval
Access Admin users

Members are refused: a 404 by default, a 403 where the site’s access-denied setting says so. Call it from a server with an admin user’s OAuth token or API key.

Authentication and authorisation

List workflows#

GET /cdna-api/workflows/workflows

Lists workflows. Without limit every match comes back. This site has none.

Access
Admin users and integrations, with an OAuth access token or an API key.
Model
Workflow, in the Reference

Parameters

propertiesquery
selector
The fields and relations to return, such as {id,name,default}.
filtersquery
name=value
Any stored field, or a relation with a dot, such as parent.id=12. Prefix the name with !, >, <, % or |. Use stored field names exactly as in the model, and compare totalCount with the unfiltered list's to confirm a filter applied.
orderByquery
string
field:ASC or field:DESC, comma-separated. Stored fields only.
limitquery
integer
Records per response. There is no default.
offsetquery
integer
Records to skip.

Example

List workflows
GET /cdna-api/workflows/workflows?limit=2&properties={id,name,default} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response 200 OK
{
  "result": "success",
  "totalCount": 0,
  "data": []
}
Real response from this documentation site

Show a workflow#

GET /cdna-api/workflows/workflow/{id}

Reads one workflow by its id.

Access
Admin users and integrations, with an OAuth access token or an API key.
Model
Workflow, in the Reference

Parameters

idpathrequired
integer
The workflow id.
propertiesquery
selector
The fields and relations to return, such as {id,name,default,steps{id,name,position}}.

Example

Show a workflow
GET /cdna-api/workflows/workflow/1 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json

Approve a branch#

POST /cdna-api/workflows/add-branch-approval

Records one group’s approval of a revision branch. It does not move the branch: it lets the transition that needs it go ahead. A group approves a branch once.

Access
Admin users and integrations, with an OAuth access token or an API key.
Returns
The new approval under data.branchApproval, and a message.
Model
BranchApproval, in the Reference

Parameters

branchbodyrequired
integer
The revision branch, by id.
groupbodyrequired
integer
The approving group, by id.

Example

Approve a branch
POST /cdna-api/workflows/add-branch-approval HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json

{
  "branch": 12,
  "group": 4
}

Withdraw an approval#

DELETE /cdna-api/workflows/branch-approval/{id}

Deletes a branch approval.

Access
Admin users and integrations, with an OAuth access token or an API key.

Parameters

idpathrequired
integer
The branch approval id.

Example

Withdraw an approval
DELETE /cdna-api/workflows/branch-approval/7 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json

List a branch’s comments#

GET /cdna-api/workflows/branch-comments/{branch.id}

Lists comments. Without limit every match comes back.

Access
Admin users and integrations, with an OAuth access token or an API key.
Model
BranchComment, in the Reference

Parameters

branch.idpathrequired
integer
The revision branch id.

Example

List a branch’s comments
GET /cdna-api/workflows/branch-comments/12 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json

Show a comment#

GET /cdna-api/workflows/branch-comment/{id}

Reads one comment by its id.

Access
Admin users and integrations, with an OAuth access token or an API key.
Model
BranchComment, in the Reference

Parameters

idpathrequired
integer
The comment id.
propertiesquery
selector
The fields and relations to return, such as {id,text,type,resolved,created}.

Example

Show a comment
GET /cdna-api/workflows/branch-comment/5 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json

Comment on a branch#

POST /cdna-api/workflows/add-branch-comment/{branch.id}

Creates a comment.

Access
Admin users and integrations, with an OAuth access token or an API key.
Returns
The new comment under data.branchComment, and a message.
Model
BranchComment, in the Reference

Parameters

branch.idpathrequired
integer
The revision branch id.
textbodyrequired
string
The comment.
typebody
string
comment, or task for something to resolve.
parentbody
integer
The comment this replies to.
cssAttachmentbody
string
Where on the page it is pinned.

Example

Comment on a branch
POST /cdna-api/workflows/add-branch-comment/12 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json

{
  "text": "Check the price in the second paragraph.",
  "type": "task"
}

Edit a comment#

PUT /cdna-api/workflows/branch-comment/{id}

Changes a comment. Fields left out keep their values.

Access
Admin users and integrations, with an OAuth access token or an API key.
Returns
The saved comment under data.branchComment, and a message.

Parameters

idpathrequired
integer
The comment id.
text, typebody
As for Comment on a branch.
resolvedbody
boolean
true marks a task done.

Example

Edit a comment
PUT /cdna-api/workflows/branch-comment/5 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json

{
  "resolved": true
}

Delete a comment#

DELETE /cdna-api/workflows/branch-comment/{id}

Deletes a comment.

Access
Admin users and integrations, with an OAuth access token or an API key.

Parameters

idpathrequired
integer
The comment id.

Example

Delete a comment
DELETE /cdna-api/workflows/branch-comment/5 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json