Getting workflow states and changing workflow steps with Document API

With the Document API, you can approve label templates using GET and PUT calls.

Important! You have to enable approval workflows in Control Center (for the folder, where your files are saved). See more in Workflows.

Getting the Workflow State

To get the workflow state with Document API:

  1. Sign in to the Developer Portal.

  2. Go to APIs and click document API - v2. The document API page opens.

  3. Scroll down and click ​Get available steps for the document​​, then click ​Try it​​.

  4. Go to Parameters > id > value and put the ID value of the file you want to get the workflow state for. To find your file ID using Document API, see Finding your Files with Document API.

  5. Scroll down and click Send.

You get a 200 OK response and the steps available for your label template.

Changing Workflow Steps

Important! Before changing workflow steps, use the Get available steps for the document​​ call. See Getting the Workflow State.

To change the workflow steps with Document API:

  1. Sign in to the Developer Portal.

  2. Go to APIs and click document API - v2. The document API page opens.

  3. Scroll down and click ​Sets the workflow step​​, then click ​Try it​​.

  4. Go to ​Parameters​ > ​id​ > ​value​​, and put in the ID value of the file you want to change the workflow steps for. To find your file ID using Document API, see Finding your Files with Document API.
  5. Go to ​Body​​ and put in your workflow step ID.
    Copy
    "workflowStepID": 3,

    Note: To get the workflow step ID, see Getting the Workflow State.

  6. Scroll down and click Send.

If your result is a 200 OK response, the API call was successful.

Note: There are several different workflow types in Loftware Cloud. Each workflow type has an ID. The ID depends on the workflow set on your folder.