Integrations

Run a process with files via Call API

13min

How to run a process via Call API:

1. Create a process in PROCESIO - Process Designer.

For this demo I created a process - Demo, with 2 input variables: a file and a string.

Document image


2. Create a API key in Automation - API Key.

Document image


3. Send a Post Request to the endpont:

https://webapi.procesio.app/api/projects/{projectID}/instances/publish

Document image

curl --location 'https://webapi.procesio.app/api/projects/projectIdValue/instances/publish' \ --header 'workspaceId: WorkspaceIDValue' \ --header 'key: ApiKeyName' \ --header 'value: ApiKeyValue' \ --header 'Content-Type: application/json' \ --data '[ { "id": "fileIdValue", "value": { "name": "filenNameValue" } }, { "id": "VariableIdValue", "value": "VariableValue" } ]'

Follow the instructions below to replace the highlighted text.

Headers:

Key

Value

workspaceId

{worspaceID value}

key

{API key name}

value

{API key value}

  • The project ID is displayed in the Process Designer under the name of the process.
Document image

  • The workspace ID is displayed in Dashboard:
Document image


Body:

[ { "id": "bf72a6c3-c5f1-4f0d-a071-88b6c93bfc3b", "value": { "name": "test.csv" } }, { "id": "ad3f088c-54c5-4537-96c2-3ad56c77c3c0", "value": "Test" } ]
  • In the body, the input variables must be initialized by ID with their values.
  • Navigate to Process Designer, open developer tools and go to Network, then Run the process.
  • In the Publish request you can find the variables IDs for your process. ( In my case I have a file and a string ):
Document image

Document image


4. Send a Post Request to the endpont:

https://webapi.procesio.app/api/file/upload/flow

Document image

curl --location 'https://webapi.procesio.app/api/file/upload/flow' \ --header 'Fileid: FileIdValue' \ --header 'ProcessId: ProcessIdValue' \ --header 'FlowInstanceid: InstanceIdValue' \ --header 'Workspaceid: WorkspaceIdValue' \ --header 'key: ApiKeyName' \ --header 'value: ApiKeyValue' \ --header 'Variablename: VariableNameValue' \ --form 'package=@"/FilePath"'

Follow the instructions below to replace the highlighted text.

Headers:

Key

Value

workspaceId

{worspaceID value}

key

{API key name}

value

{API key value}

fileId

{file Id value}

projectID

{project Id value}

FlowInstanceID

{Flow Instance Id value}

Variablename

{Variable name value}

  • File ID and Flow Instance ID are displayed in the response from the Publish api Call:

File ID: $.variables[?(@.name == 'filename')].defaultValue.id

Document image


Flow InstanceID: $.id

Document image


Body:

key

Value



package

{file}





Document image


4. Send a Post Request to the endpont:

https://webapi.procesio.app/api/Projects/instances/instanceID



Document image

curl --location 'https://webapi.procesio.app/api/Projects/instances/FlowInstanceID/launch?runSynchronous=true&secondsTimeOut=300' \ --header 'key: ApiKeyName' \ --header 'value: ApiKeyValue' \ --header 'workspaceId: WorkspaceIdValue' \ --header 'Content-Type: application/json' \ --data '{ "ProcessID": "ProcessIdValue" }'

Params:

Key

Value

runSynchronous

true

secondsTimeOut

300

Headers:

Key

Value

workspaceId

{worspaceID value}

key

{API key name}

value

{API key value}

Body:

{ "ProcessID": "{ProcessIdValue" }
Document image


5. Check Project Instances and verify if the process was completed:

Document image




Updated 23 Jan 2024
Doc contributor
Did this page help you?