Integrations
Run a process with files via Call API
13 min
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 true 239 unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type 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 true 239 unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type 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 true 239 unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type headers true 239 unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type body { "processid" "{processidvalue" } 5\ check project instances and verify if the process was completed