Publishing Workflow API
This article provides sample API calls for Publishing Workflows in Metric Insights:
-
/api/publishing_workflow
: Allows retrieving a list of all Publishing Workflows. -
/api/publishing_workflow_element
: Allows retrieving all elements of a Publishing Workflow, retrieving a single element of a Publishing Workflow, adding an element to a Publishing Workflow, updating an element of a Publishing Workflow.
Prerequisites:
- Set up API access
- Verify that you have API access and obtain a token via get_token call
Table of contents:
1. Access Admin > System > API Toolkit
2. Configure Publishing Workflows
2.1. Get Publishing Workflows
The GET request to /api/publishing_workflow
returns the data of all Publishing Workflows.
- Item: publishing_workflow
- Method: GET
- Enter an API Token
- [Run request]
Example Response
{
"publishing_workflows": [
{
"id": 7,
"name": "1-Party Review & Certification",
"enabled": "Y"
},
{
"id": 9,
"name": "3-Party Review & Certification",
"enabled": "Y"
},
{
"id": 16,
"name": "Certification Workflow",
"enabled": "Y"
},
{
"id": 12,
"name": "Financial Reporting",
"enabled": "Y"
}
]
}
Fields Description
Field Name | Value Type | Description |
---|---|---|
id | integer | The ID of the Publishing Workflow. |
name | string | The name of the Publishing Workflow. |
enabled | string | Whether or not the Publishing Workflow is enabled ("Y"/"N"). |
3. Configure Publishing Workflow Elements
3.1. Get Publishing Workflow Elements
- The GET request to
/api/publishing_workflow_element?publishing_workflow=<ID>
returns the data of all elements of a Publishing Workflows as an array ofpublishing_workflow_element
data entries. - The GET request to
/api/publishing_workflow_element/id/<ID>
returns a singlepublishing_workflow_element
data entry by its ID.
- Item: publishing_workflow_element
- Method: GET
- Provide value for one of the following parameters:
-
publishing_workflow: Enter the ID of the Publishing Workflow to get data of all of its elements
- See Get Publishing Workflows for details
-
ID: Enter the ID of a
publishing_workflow_element
data entry to get its data- See Fields Description for details
-
publishing_workflow: Enter the ID of the Publishing Workflow to get data of all of its elements
- Enter an API Token
- [Run request]
Example Response
{
"publishing_workflow_elements": [
{
"id": 157,
"publishing_workflow": 19,
"element": 2747,
"name": "Countries",
"assignee": "robert",
"stage": "Technical Review",
"history": [
{
"comment": null,
"created_by": "robert",
"created_time": "2025-04-03 14:40:05",
"stage": "Initial Review",
"assignee": null
},
{
"comment": "Please review this element.",
"created_by": "robert",
"created_time": "2025-04-03 14:41:21",
"stage": "In Progress",
"assignee": "John Doe"
},
{
"comment": "Technical review required.",
"created_by": "robert",
"created_time": "2025-04-03 14:41:49",
"stage": "Technical Review",
"assignee": "robert"
},
{
"comment": "Please review this again.",
"created_by": "robert",
"created_time": "2025-04-03 14:54:24",
"stage": "In Progress",
"assignee": "John Doe"
},
{
"comment": "Ready for technical review!",
"created_by": "John Doe",
"created_time": "2025-04-03 14:55:50",
"stage": "Technical Review",
"assignee": "robert"
}
]
},
{
"id": 158,
"publishing_workflow": 19,
"element": 122345,
"name": "Local Filesystem Countries Sales",
"assignee": null,
"stage": "In Progress",
"history": [
{
"comment": null,
"created_by": "robert",
"created_time": "2025-04-03 15:29:17",
"stage": "In Progress",
"assignee": null
}
]
}
]
}
Fields Description
Field Name | Value Type | Description |
---|---|---|
id | integer | The ID of the publishing_workflow_element data entry. |
publishing_workflow |
integer |
The ID of the Publishing Workflow. |
element |
integer |
The ID of the element. |
name |
string |
The name of the element. |
assignee |
string |
The username of the assignee. |
stage |
string |
The name of the current Publishing Workflow stage. |
history | array | An array containing information on past stages. Each data entry contains the following information: comment , created_by , created_time , stage , assignee . |
comment |
string |
The comment that was made in this Publishing Workflow stage. |
created_by |
string |
The username of the user who moved the element to this stage of Publishing Workflow. |
created_time |
string |
The time when the element was moved to this stage of Publishing Workflow. |
stage |
string |
The name of the Publishing Workflow stage. |
assignee |
string |
The username of the user to whom the element was assigned in this Publishing Workflow stage. |
3.2. Add Element to Publishing Workflow
NOTE: Element's Publishing Workflow can be changed by running this request with the other Publishing Workflow ID. The element will be transferred to a new Publishing Workflow.
The POST request to /api/publishing_workflow_element
adds the element to the Publishing Workflow.
- Item: publishing_workflow_element
- Method: POST
- Enter the ID of an existing
publishing_workflow_element
data entry- See Get Publishing Workflows for details
- Select JSON request and provide values for the following parameters:
-
publishing_worfklow
: The ID of the Publishing Workflow; -
element
: The ID of the element; -
stage
: The name of the Publishing Workflow stage.
-
- Enter an API Token
- [Run request]
- The data entry of the added element is displayed in the Raw response field
- See Example Response and Fields Description for details
3.3. Update Publishing Workflow Element
- The PUT request to
/api/publishing_workflow_element/id/<ID>
updates thepublishing_workflow_element
data entry allowing forstage
andassignee
update. - The PUT request to
/api/publishing_workflow_element
with a newpublishing_workflow
parameter value assigns the element to a new Publishing Workflow.
- Item: publishing_workflow_element
- Method: PUT
- Enter the ID of the
publishing_workflow_element
data entry which needs to be updated- See Get Publishing Workflows for details
- Select JSON request and provide values for the following parameters:
-
publishing_worfklow
: The ID of the Publishing Workflow; -
element
: The ID of the element; -
assignee
: The username of the assignee; -
stage
: The name of the Publishing Workflow stage.
-
- Enter an API Token
- [Run request]
- The updated
publishing_workflow_element
data entry is displayed in the Raw response field- See Example Response and Fields Description for details