Integration (API's)

How do I trigger a RESTful API when a process starts?

When creating a process you have an option when creating a step which to create a REST API step at the bottom of the drop down:

 

blobid0.png

 

Once this type is added the following configuration options are shown:

blobid1.png

One can see that on top of the normal options there is one called: 

  • If the api call fails, allocate step to 

 

So if it were to fail it would automatically assign it to a user of your selection.  

There is also a Request Url setting. This will be the endpoint of the API that should be called when the process is started.  

The Verb setting contains GET, PUT, POST for the purposes of futureproofing the functionality. Initially the POST option is the only one you will be using.  

Likewise the Content type also needs to be in JSON format.  

  

Request Headers 

This is present to enable additional security on the post to the API should you're API require it. You can add n number of these.  

  

Response Mapping 

This enables you to map Key Information into a process from a response returned from an API. The key thing is this requires to be in JSON format. If a response is provided in anything other than JSON this will not work.  

To provide an example let's say an API response provided a response which gave a case reference i.e. 

"response: "200", 

 "3953403" 

You could use the mapping element to automatically update the Key Information tab of the process in OpenProcess with this information. So the following shows how this would be mapped: 

 

blobid2.png

 

Once set up, as soon as the process is started, the API call is successful it would result in the following being added to the process: 

 

blobid3.png

For further information, the JSON path setting follows the standard methodology of doing this and more details of example can be found here: 

https://www.newtonsoft.com/json/help/html/QueryJsonSelectToken.htm