Find answers to your technical questions and learn how to use our products
Search suggestions:
Find answers to your technical questions and learn how to use our products
Search suggestions:
The REST API task performs advanced customization of the workflow.
With the REST API task, you can:
Create and configure API calls to endpoints
Process the response and declare new data to the workflow
Configure and create task outputs based on task results
Update information available in the workflow
You can use the REST API task to collect additional information from an external source for better routing or providing this information to agents. For example, you can get additional information from the CRM of your company or enrich your CRM with the newly received data.
Apart from making calls, you can rewrite the existing data in cache or in properties of tasks downstream of the workflow with the REST API task. Using the REST API task, you can also update the predefined set of outputs in the REST API task based on the results you receive.
You can view the variables used in the evaluated conditions of the REST API task for an instance from the Instances tab in Orchestration Manager. You can also view the current state of all the available variables.
This task is available to only Administrator users.
The REST API task makes API calls internal to Avaya Experience Platform™ Public Cloud components and external to other endpoints. You can use the Properties tab to create a request to the API endpoint: choose a method, specify REST URI, and identify header, body, and parameters. To configure an API call, for internal API calls, see the Avaya Experience Platform™ Public Cloud API documentation at https://developers.avayacloud.com/. For external calls, see API documentation that the API vendor provides.
Properties |
Description |
|---|---|
Method |
HTTP verb used for the request. The currently supported verbs are the following:
|
Rest URI |
URI of the REST endpoint. To set Rest URI as a variable, click If you update or create a new certificate for a workflow, you must create the certificate with the full chain to prevent the workflow from failing and causing an outage. |
Header |
A list of key-value pairs that you add to the request as headers. By default, Orchestration uses the header key Content-Type. No user input is required if you use the default key. When you change the body type, the content type in the header changes automatically. To set Header as a variable, click |
Body |
Body of your request in the following format:
You can use variables in all body formats. To add a variable, click |
Param |
A list of key-value pairs that you add to the request as query parameters. You can use variables as query parameter values. To set a query parameter as a variable, click |
Properties |
Description |
|---|---|
Retry count |
The number of times the request is sent if the request fails with an error. The default value is 1. The available range is between 1 and 10. |
Request Timeout (sec) |
The request timeout in seconds after the expiry of which the request fails with an error. The default value is 5 seconds. The maximum value is 200 seconds. |
Socket Timeout (sec) |
The WebSocket timeout in seconds after the expiry of which the request fails with an error. The default value is 5 seconds. The maximum value is 300 seconds. |
Orchestration supports the following authentication methods:
Basic authentication
Bearer Token
OAuth 2.0
You can select No Auth if no authentication is required for the REST endpoint.
To configure authentication, for internal API calls, see the Avaya Experience Platform™ Public Cloud API documentation at https://developers.avayacloud.com/. For external calls, see API documentation that the API vendor provides.
With a response schema, you can declare the properties received during an API call and make them available to the subsequent tasks. To set up tasks in the workflow, in Orchestration, you can use a set of predefined properties available to the workflow. However, the REST API task is not limited to such a predefined set, as you can get any required information from an endpoint. To provide Orchestration with information about the data you expect to receive and properties that Orchestration can use later in the workflow, you use response schemas. Using response schemas, you can enlarge the list of properties for the result mapping in the same REST API task and the subsequent tasks.
In Orchestration, you can use schemas for success and error responses. You can take the schema from the API documentation of the REST endpoint or generate it with the dedicated software. Alternatively, you can use the JSON Schema Editor in Orchestration. To open JSON Schema Editor, click JSON Schema Editor.
With the REST API task, you can use the information available in the records of the CRM of your company for better routing. For example, you can check in your CRM databases whether the customer is a sales lead and provide the customer with appropriate treatment based on this information. During pre-routing, Orchestration collects a set of data about the customer that you can use to identify this customer in your CRM. Using an API call, you send this customer identifier to your CRM to search for this customer and verify whether this customer is a sales lead. When your CRM responds, to declare the received data to the workflow, you must specify a response schema. The success response schema can look as follows:
{
"data": [
{
"Owner": {
"name": "Jane Doe",
"id": "397111000000273001",
"email": "janed@xyz.com"
},
"Company": "Doe Motor Works",
"Email": "jane@doe.ie",
"$currency_symbol": "$",
"Last_Activity_Time": "2021-09-30T21:49:23+02:00",
"Industry": null,
"$state": "save",
"Unsubscribed_Mode": null,
"$converted": false,
"$process_flow": false,
"Street": null,
"Zip_Code": null,
"id": "397111000000273184",
"$approved": true,
"Created_By": {
"name": "Jane Doe",
"id": "397111000000273001",
"email": "janed@xyz.com"
},
"Annual_Revenue": null,
"Secondary_Email": null,
"Description": null,
"Rating": "Active",
}
],
}
As a result, Orchestration can use the declared properties with those collected earlier in the workflow for more effective routing decisions.
Using outputs, you can configure a workflow based on results that you receive during the REST API task. By default, all REST API tasks have success and error outputs. You can edit default outputs and create customized outputs based on required conditions or timeout values. When creating a new output, click Add Output and fill in the following fields:
Field |
Description |
|---|---|
Output Label |
The unique output name that you can see in the list of task outputs. You can connect this output with the next task in the workflow. |
Choose output condition |
Output conditions based on logic or timeout values. You can choose the following:
|
To change the order of outputs, click
and drag the output to the required position. Orchestration checks configured conditions in a descending order. When one of the conditions is met, Orchestration does not check the subsequent conditions. Order the conditions considering their priority.
For example, to configure different treatments for active sales leads and ordinary customers, you must create different outputs based on the results received from your CRM. From the response schema you know that the property Rating shows whether the customer is an active sales lead. When the value is Active, the customer is an active sales lead who needs to undergo specific treatment. When the value is null, the customer is not an active sales lead, and Orchestration must provide another treatment to this customer. Consequently, it is enough to have a successful result. Thus, you need to configure two success outputs:
Success - Sales Lead
Conditional logic data.response.Rating == "Active", where data.response.Rating is the required current task variable.
Success - Other
Conditional logic result == 'success', where result is the result variable.
With result mapping, you can manipulate the data available in the workflow: add new data to the cache, rewrite the existing cache data, or change downstream task properties. As data, you can use cache variables or results of the current and previous tasks.
To map the results with the places to store or use this data, fill in the following fields:
Field |
Description |
|---|---|
Destination |
The destination point where you save data. You can save data in subsequent tasks as properties or in the cache as cache variables. To specify the required destination, click the Destination field and select the variable:
To create a new cache variable, type a new variable name in Type Custom variable and click |
Value |
The value that you pass to the destination point. As a value, you can use any data available to the workflow:
To add a value, click |
For example, you plan to receive information about the customer's location from your CRM and use it for correct customer routing. With the REST API task, you make an external API call. When you receive a response, on the Response Schema tab, you specify the response schema that declares the properties that you receive from the CRM system. Now you can map the received data with the place where you plan to store them.
To store the location, you must create a new cache variable. In the Destination field of the Result Mapping tab, select Cache Variables. In the Type Custom variable field, type location. To confirm the creation of a new cache variable, click . Since you forward the results of the current task, select Current task Variables > City as the value. You must create a separate mapping for each property to store in the cache.
You can define the mapping for the following results:
error
success
Successful request but unable to parse response
To each result section, you can add multiple result mappings.
Target tasks are tasks located downstream of the workflow. Unlike other tasks, the REST API task does not have fixed target tasks for its outputs. You can put the REST API task anywhere in the workflow and connect it with any task.
Output |
Description |
Target task |
|---|---|---|
Success |
Orchestration received a success response from the REST endpoint. |
Any task |
Error |
An error occurred during the task execution. You can handle the interaction with the Error Handler task or proceed with the workflow as if Orchestration did not perform a REST call. |
Any task |
Customized output |
Function depends on configuration of the customized output on the Outputs tab. |
Any task |