Configuring the Workflow REST API
The page shows the configuration options once the API is enabled:
You must turn on the Workflow API feature before using the service. Click the Slider to activate the Workflow REST API preview.
Select the Workflow REST API version to use on your system. Selecting the version changes the value of the Workflow API URLs, all other settings apply globally to all versions of the endpoint. This provides backward compatibility for any 3rd party solutions developed using earlier versions of the API. The version is reflected in the Swagger URL and Base URL.
The Swagger file describes the Workflow REST endpoints to third party software, such as Microsoft Flow. Click on Copy to copy the Swagger file URL address to your clipboard.
Click on Open Link to open the K2 Workflow Api swagger page and access the list of operations, tasks, and workflow functions.
Click on Download to open a new web page displaying the JSON swagger file. Then use File - Save As from your browser to save the descriptor file. You can now use the descriptor file in a third party application, like Microsoft Flow.
Swagger Page
Use the swagger page to test, use, or familiarize yourself with the endpoint functions.
You can use the Try it out! button on the swagger page to get a JSON response from the web service. For example, the Get Workflows GET function will return the number of workflows on the K2 server, and give the id, defaultVersionID, name, folder, and systemName values for each workflow.
A POST swagger function may require parameters and instance data. For example, the Start Workfow POST function needs the workflow id number. Body values can be entered; use the Example Value JSON examples to guide your construction, or use empty brackets {} to enter no data. Add Data fields, XML fields, and Item References where needed. A full schema of a workflow is available from the GET workflows/{id} function. The GET workflows/{id}/schema function provides JSON schema formatted as a string ready for Microsoft Flow.
The Base URL contains the K2 server address followed by the API path and version, such as https://k2.denallix.com/api/workflow/v1. Click on the Copy "@" icon to copy the Workflow REST API endpoint URL.
Add domains to the CORS list to enable those Apps or Web services to use the Workflow REST API calls.
Click on the plus icon to add a new domain. Select a domain and click on the trash can to delete it. Click on the refresh icon to reload the list of allowed domains.
When adding and removing URLs from the CORS list, you must click the Apply Changes button for the changes to take effect.
- If you leave the page without clicking Apply Changes, the changes will be lost.
- If you click on the Refresh icon before clicking Apply Changes, a warning popup display
- If you click ok, the changes (addition or removal) will be lost.
- If you click cancel, the pop up will close and nothing will happen.
The service uses Basic and OAuth Authentication.
You must use a custom connector when using OAuth for authentication.