Processes
Process Designer
Process Custom Response
8min
looking to integrate with a third party app that requires a response in a specific format? the proposed procesio solution is the custom response here's how it works when running a process in sync mode using the run endpoint and setting a process custom response, the process will respond with the expected value format as set from within the process process import both processes created in this document are available for import below please check the steps for the input variables values requested when running the processes https //archbee doc uploads s3 amazonaws com/pd o7nzlwdisbwglsha9q/9rtpzrjgiisea0kw0 mw9 customresponse procesio the custom response is passed as a dynamic value through a specific endpoint when the process ends there are two options for leveraging the custom response 1\) run sync endpoint post https //webapi procesio app/api/projects/{id}/run step 1 step 10 2\) get custom response endpoint get https //webapi procesio app/api/projects/{id}/instances/{instanceid}/customresponse step 1 step 17 visit our swagger for more details example process imagine the following use case as a video game vendor, you are in need of updating prices on multiple platforms each platform requires a specific format of the payload to perform the price update below is a simplified version extracting the custom response (price) from the api call that returns all the details of a product step 1 go to the process designer and create a new process or open an existing one from within a process, create the following variables name type single value set as productdetailsjson json yes output customresponseprice double yes output statuscode integer yes the custom response variable can have any type depending on the response you are expecting step 2 on the process page, click on the custom response icon β step 3 click on the add variable button and select the customresponseprice variable as process custom response step 4 in the process builder add the call api action and the json mapper action step 5 create rest api credential and set it's base url as https //graph nintendo com/ with no authentication in the call api action, use the get method and set the below mentioned enpoint ?operationname=productsbysku\&variables=%7b%22locale%22%3a%22en us%22%2c%22personalized%22%3afalse%2c%22skus%22%3a%5b%227100067229%22%2c%227700013808%22%5d%7d\&extensions=%7b%22persistedquery%22%3a%7b%22version%22%3a1%2c%22sha256hash%22%3a%2243251a1c4b24ba477cc4e12a8fd13e03bcc4dfee223ad0bb8c3792f001a6ebe6%22%7d%7d headers value content type application/json; charset=utf 8 configure the call api action to get the product details and store them in the productdetailsjson variable (the statuscode is usefull for debugging) step 6 configure the json mapper action by selecting the productdetailsjson as input, adding the query $ data products\[0] prices minimum regularprice to select only the price value, and store the result in the customresponseprice variable step 7 validate the process and run it step 8 create an api key, with procesio api keys for custom response via synchronous calls we'll use swagger as per below step 9 we'll login to swagger using the previosly generate api key step 10 using the post https //webapi procesio app/api/projects/{id}/run endpoint with the following configuration add the process id set runsynchronous on true workspace name or workspaceid request body {"payload" \[]} hit execute for obtaining the custom response from an instance you'll need to also follow the steps below step 11 set up a credential for a restapi with the following base url https //webapi procesio app/ save the credential without testing it step 12 create a new process and the following variables within name type single value set as processid guid yes input instanceid guid yes input customresponse json yes output statuscode integer yes workspaceid guid yes input apikey string yes input apikeyvalue string yes input step 13 add a call api action select the rest api credential configured at step 11 configure the request with the endpoint /api/projects/\[id]/instances/\[instanceid]/customresponse in the endpoint replace \[id] and \[instanceid] with the variables created at step 12 configure the call api as per below step 16 validate and run the process obtain the process id from witin process designer and instance id from witin process instances for the process ran at step 1 the workspaceid is your workspace id and it can be obtained from within dashboard the apikey and apikeyvalue were created at step 8