Run a process with files via Call API
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 Document image](https://images.archbee.com/pD-o7nZLwDiSBwGlsHA9q/DjQKHfnjeWyFx1Y0Pu_JM_image.png?format=webp)
2. Create a API key in Automation - API Key.
![Document image Document image](https://images.archbee.com/pD-o7nZLwDiSBwGlsHA9q/EGWBFrOHo6qqmAzRteCpk_image.png?format=webp)
https://webapi.procesio.app/api/projects/{projectID}/instances/publish
![Document image Document image](https://images.archbee.com/pD-o7nZLwDiSBwGlsHA9q/gtio1Mr0x0DSOumYxC-3h_image.png?format=webp)
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 Document image](https://images.archbee.com/pD-o7nZLwDiSBwGlsHA9q/DjQKHfnjeWyFx1Y0Pu_JM_image.png?format=webp)
- The workspace ID is displayed in Dashboard:
![Document image Document image](https://images.archbee.com/pD-o7nZLwDiSBwGlsHA9q/rME8W9MpI7RaOyyE2Pdgn_image.png?format=webp)
Body:
- 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](https://images.archbee.com/pD-o7nZLwDiSBwGlsHA9q/r7oSnVRs4YBwLKKVAvv2o_image.png?format=webp)
![Document image Document image](https://images.archbee.com/pD-o7nZLwDiSBwGlsHA9q/Uy559VmKN-IqBbmBNVYlQ_image.png?format=webp)
https://webapi.procesio.app/api/file/upload/flow
![Document image Document image](https://images.archbee.com/pD-o7nZLwDiSBwGlsHA9q/943109qgl4AomPuJUmKD1_image.png?format=webp)
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 Document image](https://images.archbee.com/pD-o7nZLwDiSBwGlsHA9q/rm9sq_rjENk7CS1vYUphf_image.png?format=webp)
Flow InstanceID: $.id
![Document image Document image](https://images.archbee.com/pD-o7nZLwDiSBwGlsHA9q/rphvqPYxQ7D2OvRcaL6FC_image.png?format=webp)
Body:
key | Value | |
package | {file} | |
![Document image Document image](https://images.archbee.com/pD-o7nZLwDiSBwGlsHA9q/08TWuoPpS_eUKcCajnoJk_image.png?format=webp)
https://webapi.procesio.app/api/Projects/instances/instanceID
![Document image Document image](https://images.archbee.com/pD-o7nZLwDiSBwGlsHA9q/6Pw1dKV7UrKFKNhYXqbBD_image.png?format=webp)
Params:
Key | Value |
runSynchronous | true |
secondsTimeOut | 300 |
Headers:
Key | Value |
workspaceId | {worspaceID value} |
key | {API key name} |
value | {API key value} |
Body:
![Document image Document image](https://images.archbee.com/pD-o7nZLwDiSBwGlsHA9q/5hlc0FBt-mVIXeuLX-jjN_image.png?format=webp)
5. Check Project Instances and verify if the process was completed:
![Document image Document image](https://images.archbee.com/pD-o7nZLwDiSBwGlsHA9q/Y_9r2f92BcWY2mIHWEsi9_image.png?format=webp)