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:

Table of contents:

  1. Access Admin > System > API Toolkit
  2. Configure Publishing Workflows
    1. Get Publishing Workflows
  3. Configure Publishing Workflow Elements
    1. Get Publishing Workflow Elements
    2. Add Element to Publishing Workflow
    3. Update Publishing Workflow Element 

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.                

  1. Item: publishing_workflow
  2. Method: GET
  3. Enter an API Token
  4. [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 of publishing_workflow_element data entries.
  • The GET request to /api/publishing_workflow_element/id/<ID> returns a single publishing_workflow_element data entry by its ID.        
  1. Item: publishing_workflow_element
  2. Method: GET
  3. 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
    • ID: Enter the ID of a publishing_workflow_element data entry to get its data
  4. Enter an API Token
  5. [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.

  1. Item: publishing_workflow_element
  2. Method: POST
  3. Enter the ID of an existing publishing_workflow_element data entry
  4. 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.
  5. Enter an API Token
  6. [Run request]
  7. The data entry of the added element is displayed in the Raw response field

3.3. Update Publishing Workflow Element

  • The PUT request to /api/publishing_workflow_element/id/<ID> updates the publishing_workflow_element data entry allowing for stage and assignee update.
  • The PUT request to /api/publishing_workflow_element with a new publishing_workflow parameter value assigns the element to a new Publishing Workflow.
  1. Item: publishing_workflow_element
  2. Method: PUT
  3. Enter the ID of the publishing_workflow_element data entry which needs to be updated
  4. 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.
  5. Enter an API Token
  6. [Run request]
  7. The updated publishing_workflow_element data entry is displayed in the Raw response field