Introduction
Smart routing provides the ability to outsource the algorithm to calculate the routing preference of eligible agents. The smart routing step on the waiting room node allows an administrator to configure the HTTP request to a third-party resource. A POST request will be sent with a list of eligible agents, task data, and any custom fields that may have been specified as part of the configuration. The expected response is the list of agents sorted in order of routing preference, task data, and any custom fields that will be attached to the interaction. The interaction will be attempted to be routed to each agent from the list in a top-down approach. If the list is exhausted without being routed to an agent, the system falls back to the default Zai method of routing.
Configuration
Enable smart routing:
Toggle the switch to "yes" where it says "Would you like to enable Smart Routing?".
Configure the URL:
This must be a fully qualified URL, for example:
http://api.zailab.com/some-resource
Smart routing supports http as well as SSL/TLS (https). In order to ensure the security of data, https is strongly recommended.
The URL can accept path variables as well as query parameters:
http://api.zailab.com/some-resource/${resourceId}?queryParam=${queryId}
Where ${resourceId} refers to a variable that has already been set called resourceId and queryId refers to a variable that has already been set called queryId.
Any variable referenced must be enclosed within ${}. The ZaiLab flow processor will substitute the variable value for this placeholder if it can find the variable.
The URL is a required field.
Following the URL, the request headers can optionally be set:
The headers can be any number of key-value pairs that are required. Common header values would be Content-Type headers as well as Authentication/Authorization headers.
The Administrator can add each key-value pair and click the ‘+’ icon on the right-hand side to add the header to the request. The ‘+’ icon will then change to a delete icon to remove the header.
Finally, any custom fields can optionally be set:
Like headers, custom fields can be any number of key-value pairs. The Administrator can add each key-value pair and click the ‘+’ icon on the right-hand side to add the custom field to the request. The ‘+’ icon will then change to a delete icon to remove the custom field.
Request
The Zai System will POST the request to the configured URL with the following payload:
{
"members": [
{
"id": "string", // unique ID
"externalReference": "string",
"email": "string"
}
],
"task": {
"id": "string", // unique Call ID
"source": "string",
"channel": "string",
"site": {
"id": "string",
"name": "string"
},
"service": {
"id": "string",
"name": "string"
},
"skills": [
{
"id": "string",
"name": "string",
"mandatory": boolean
}
]
},
"customFields": {
"field1": "string",
"field2": "string"
}
}
Response
The Zai System expects a response with the following structure:
{
"members": [
{
"id": "string",
"externalReference": "string",
"email": "string"
}
],
"task": {
"id": "string",
"source": "string"
},
"customFields": {
"field1": "string",
"field2": "string"
}
}