Create Global REST operations
Global REST operations are tenant-level operations that are available for all the workflows in the tenant. These operations serve as a reference for the workflow developers. When added to a workflow step, the configurations of the global operations are copied to the step, creating a Workflow-level or Local operation. The local operation can be edited or used as-is, as required. This enables the workflow developers to reuse pre-built operations. In a global operation, we define the API, parameters to be passed to the web service, Request payload, and the attributes to hold the response received from the web services.
Any change to the Local operation does not impact the Global operation. Likewise, any update to the global operation does not impact the workflow that references the global operation.
Once the Application and Instance are created, you can create the required global operations for the tasks you need to perform on the target system.Â
To create an operation, follow the below steps:
On the Connected Apps page, select the application. Click Create Operation as shown below.
On the Create Operation page, add the web service details.
In the Operation Details tab, enter the Operation Name.
The system automatically displays the default Skill Domain of the tenant.Â
Uniform Resource Identifier (URI), is used to refer to the information resource. Enter the URI.
Select the operation Method. It uses an API request chaining framework to push or request data from your websites, systems, and web applications using Webservices.
The following operation methods are available:Get:Â To retrieve data
Post:Â To create data
Put:Â To edit the data
Delete:Â To delete the data
Patch: To make partial updates to the resource
Specify the operation Timeout (in milliseconds), the amount of time to wait for a web service response when invoking an outbound request. The default value is 10000 milliseconds, 10 seconds, and the maximum allowed value is 3 mins, 180000 milliseconds.
Next, add Input Parameters. These are the values required to perform the operation. You may add as many parameters as required.
Click on Add.
Add the Parameter name and Data type.
Mark the field ‘Required’, as necessary and add a validation message.
Add the required validation.
Next, add Request Configurations. These are the details required to connect to the external web service.
Path Parameters: The path parameter is part of a path segment that occurs after its name. Path parameters offer a unique opportunity to dynamically replace the values and pass them in the URL. Example, http://myserver.com/some-path/{parameter1}/path-continued/{parameter2}. You can overwrite the configuration defined at the instance level or continue using the same and you may need to add the operation-specific variable and values.Â
Enter the External Field and the Value.Query Parameters: The query parameters are sometimes referred to as optional parameters. The query parameters are separated from the hierarchical parameters by the question mark. Query parameters appear in the URL after the question mark (
?
) after the resource name. Example, https://myserver.com/resource-name?param1=value1¶m2=value2. You can overwrite the configuration defined at the instance level or continue using the same and you may need to add the operation-specific variable and values.Â
Enter the External Field and the Value.Headers: Headers are mostly classified as request headers. You will have to set the request headers when you are sending the request. You can overwrite the configuration defined at the instance level or continue using the same and you may need to add the operation-specific variable and values.Â
Enter the External Field and the Value. The following sample headers are encountered the most.Authorization: Includes credentials containing the authentication information of the client for the resource being requested.Â
Accept-Charset:Â This is a header that is set with the request and tells the server about which character sets are acceptable by the client.Â
Content-Type:Â Indicates the media type (text/HTML, text/JSON, XML/custom or multipart/form-data) of the response sent to the client by the server, this will help the client in processing the response body correctly.
Use multipart/form-data as Content-Type to send an attachment file to the client-server.
If you wish to overwrite the Global Header configurations defined at the Instance level, select Ignore Global Headers. The system will then consider the configurations defined at the Operation level. Similarly, you may overwrite the Path Parameter and Query parameter as well.
Request Payload:Â Request payload needs to be passed to complete the request. Form Data is the default encoding a web form uses to transfer data. The text box area accepts simple key-value pairs and complex/nested JSON.Â
Next, configure the Output parameters. These parameters are used to process and hold the data or response received from the external web service. The following type of output parameters are available:
System Defined Outputs: These are system parameters that are available by default. The parameters are automatically assigned values with workflow execution.
Response Output Parameters: Define the parameters to hold the response received from the web service. Here you can parse the JSON response, and save the value in the parameter.
Meta Parameter: Meta Parameters are used to hold the information received in the Response Header.
Â
Once done, click on Save.
Based on the response received, use the appropriate Extractor Type:
Use Extractor Type → JSONPath when a value from the received JSON response is to be assigned to the attribute e.g. Expression points to a JSON path e.g. $.data.TicketIdentifier, $.data.items[*].Priority.
Use Extractor Type → Indirect JSONPath when a value from a JSON type attribute is to be assigned to the attribute e.g. Expression points to an attribute that holds a JSON path e.g. @{local.items}→$.[*].TicketIdentifier
Use Extractor Type → Xpath when a value from an XML path is to be assigned to the attribute i.e. Expression points to an XML Path e.g. //AddResponse/Description
Use the data type based on the value held in the parameter. For example, use JSON data type attribute to store JSON data received from integration. To refer to a list/array of values in a JSON path, use the STRING_LIST attribute.