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 2\ create a api key in automation api key 3\ send a post request to the endpont https //webapi procesio app/api/projects/{projectid}/instances/publish curl location 'https //webapi procesio app/api/projects/ projectidvalue projectidvalue /instances/publish' \\ \ header 'workspaceid workspaceidvalue workspaceidvalue ' \\ \ header 'key apikeyname apikeyname ' \\ \ header 'value apikeyvalue apikeyvalue ' \\ \ header 'content type application/json' \\ \ data '\[ { "id" " fileidvalue fileidvalue ", "value" { "name" " filennamevalue filennamevalue " } }, { "id" " variableidvalue variableidvalue ", "value" "variablevalue" } ]' follow the instructions below to replace the highlighted 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 the workspace id is displayed in dashboard 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 ) 4\ send a post request to the endpont https //webapi procesio app/api/file/upload/flow curl location 'https //webapi procesio app/api/file/upload/flow' \\ \ header 'fileid fileidvalue fileidvalue ' \\ \ header 'processid processidvalue processidvalue ' \\ \ header 'flowinstanceid instanceidvalue instanceidvalue ' \\ \ header 'workspaceid workspaceidvalue workspaceidvalue ' \\ \ header 'key apikeyname apikeyname ' \\ \ header 'value apikeyvalue apikeyvalue ' \\ \ header 'variablename variablenamevalue variablenamevalue ' \\ \ form 'package=@"/ filepath filepath "' follow the instructions below to replace the highlighted 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 flow instanceid $ id body key value package {file} 4\ send a post request to the endpont https //webapi procesio app/api/projects/instances/instanceid curl location 'https //webapi procesio app/api/projects/instances/ flowinstanceid flowinstanceid /launch?runsynchronous=true\&secondstimeout=300' \\ \ header 'key apikeyname apikeyname ' \\ \ header 'value apikeyvalue apikeyvalue ' \\ \ header 'workspaceid workspaceidvalue workspaceidvalue ' \\ \ header 'content type application/json' \\ \ data '{ "processid" " processidvalue 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" } 5\ check project instances and verify if the process was completed