REST Task
The REST Task in the Liberate platform enables you to make HTTP requests to external APIs using a chosen connection. Before configuring a REST Task, you need to set up a connection for the desired API, such as Salesforce, and ensure it's available within your project. Here's how you can configure a REST Task:
Select the REST Task within your workflow.
Choose the connection you want the task to utilize (e.g., "Salesforce Connection").
Specify the method type (e.g., POST, GET).
Optionally, provide a URL path beyond the base URL from the connection.
Select the data type for the request payload (JSON, Form data, or Text).
Define the request payload using the available options based on the chosen data type.
Request Transformation
The Request Transformation feature in the Liberate platform allows you to modify the data sent to the API within a REST Task. This transformation can access any data available in the workflow up to that particular step. In Liberate, Request Transformations are written using JSONata expressions.
To create a Request Transformation:
- Within the REST Task, navigate to the Request Transformation section.
- Write a JSONata expression that modifies the request payload.
- Specify the type of transformation, such as "body" or "headers".
- Define the JSONata expression in the "expression" field.
- For more details on writing JSONata expressions, refer to the JSONata documentation.
Here's an example of a Request Transformation in the Liberate platform:
[
{
"type": "body",
"expression": "{'Name': $concat('Claim-', $millis()), 'ClaimNumber__c': $concat('CLM-', $millis()), 'PolicyNumber__c': $.policyResponse.policyNumber, 'ClaimantName__c': $.name}"
}
]Response Transformation
The Response Transformation feature in the Liberate platform allows you to reshape the data returned from the API within a REST Task. This transformation enables you to customize the structure and format of the response data for subsequent tasks in the workflow.
To create a Response Transformation:
Within the REST Task, navigate to the Response Transformation section.
Write a JSONata expression that reshapes the response data.
Specify the type of transformation, such as "body" or "headers".
Define the JSONata expression in the "expression" field.
Updated 9 months ago
