RESTCall Step
Description:
Makes a REST call and returns JSON or XML
Inputs
- restURL – URL to call
- method – http method to use, Get, Post, Put, Delete
- username – authentication user name
- password – authentication password
- payLoadType – XML, JSON, FormURL or FormData
- requestBody – JSON or XML body
- responseType – return type JSON or XML
- sourceFilePath – file path to upload
- headers – custom headers to add
- varToStoreResult – variable to store the response
Returns
- True – step executed successfully
- False – step failed to execute
Usage:
Example:
Let’s build and execute the RESTCallDef example.
- Create a new definition called “RESTCallDef”
- Select the definition and click the “design” button
- Drag a “RESTCall” step from the toolbox
- Connect the dots between the start and “RESTCall” step
- Define a variable/global to store the result after execution
- Click on the "RESTCall" step to configure its "Settings" properties. Provide a name to the step. Provide the REST call URL. Select the REST call method (Get, Post, Put, Delete, Patch). Provide the variable/global to store the result.
- Click on the "RESTCall" step to configure its "Advanced" properties. Provide the authentication user name and password. Select the payload type (a name to the step. Provide the REST call URL. Select the REST call method (XML, JSON, FormURL, Formdata). Select response type (XML, JSON, Formdata). Provide the server file path of the source file to be uploaded. Click on SAVE to confirm the changes.
- Click on “Headers” to configure.
- The “Logging” setting configuration is necessary for documentation and also measure the workflow progress and the percent complete. This is acheived by configuring the step state and percent fields individually as shown in the images below. Configure the “Logging” using the following properties.
- Save the process definition, create a new process instance and execute. Render the process instance. Click on the process step to view the properties. The step should get access token and store into variable/global.