Triggers
Overview
1. What is a Trigger?
A trigger lets you receive notifications when your data crosses certain pre-defined conditions. For example:
Event type = predictive dialler attempt
Campaign ID = 10
Outbound lead attempts >= 3
When a trigger fires, actions assigned to the trigger will be executed based on configured parameters.
The triggers currently available are:
Trigger Type | Description |
---|---|
Dialler Call Outcome (Predictive) | The event is triggered when an outcome is updated from a predictive campaign. Can be a system outcome when not handled by an agent (busy, no answer, answering machine, etc), or a wrap code when an agent wraps the call |
Dialler Call Outcome (Preview) | The event is triggered when an agent wraps a call in a preview campaign |
Agent Wrap | The event is triggered on every agent interaction wrap event (does not currently support webchat). |
MPIQ Attempt | The event is triggered on every MPIQ attempt |
Abandoned in Workflow | The event is triggered on every Inbound Voice activity where it is Abandoned in the Workflow |
Abandoned in Queue | The event is triggered on every Inbound Voice activity where it is Abandoned in the Queue |
More triggers are being developed and will be added in future releases. For any suggestions for new triggers, please contact your Account Manager who can assist in logging a feature request for evaluation for future development.
2. What is a Webhook?
A webhook is one of a few ways web applications can communicate with each other. It allows you to send real-time data from one application to another whenever a given event occurs.
3. Webhooks vs APIs
With an API, you get data through a process known as ‘polling’. This is when an application periodically makes a request to an API server to check for new data.
A webhook, on the other hand, allows the provider to send (i.e ‘push’) data to an application as soon as an event occurs.
Webhooks are less resource-intensive because they eliminate the need for constantly polling (checking) for new data.
4. Limitations
The application will not process webhook responses larger than 10kb. Make sure your web service provides responses using standard HTTP response status codes.
For more information on response codes, please refer to:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
5. Webhook Retries
If the response code from a webhook request is not in the 2xx family, a retry will be dispatched after 10 minutes. The retries will happen for 48 hours or until the response code is a 2xx.
Webhook request details can be viewed in the Triggers page (Integration > Triggers) in Workspace, under the Event Logs tab within that webhook.
6. Handling Events
Triggers and webhooks can be configured through the Workspace UI. The module is available from the menu Integration > Triggers.
If the item is not available, please check the module permission under the User Roles module (Administration – User Roles).
7. Create a New Trigger
If the Integration - Triggers is not available, please check the module permission under the User Roles module (Administration – User Roles).
Trigger configuration is targeted to advanced users with JSON format knowledge.
Select Integration – Triggers and click the Create new trigger button to add a new trigger
Name your trigger & select the event type:
Event Type | Description |
---|---|
Dialler Call Outcome (Predictive) | The event is triggered when an outcome is updated from a predictive campaign. This can be a system outcome when not handled by an agent/by the dialler (busy, no answer, answering machine, etc), or a wrap code when an agent wraps the call |
Dialler Call Outcome (Preview) | The event is triggered when an agent wraps a call in a preview campaign |
Agent Wrap | The event is triggered on every agent interaction wrap event (does not currently support webchat). |
MPIQ Attempt | This event is triggered based on the status and/or attempts of a MPIQ. For example, a trigger can be created to send a notification to a manager for every payload returned with a “failed” Status, or when the attempts field equals the maximum attempt threshold set in the configuration. |
Abandoned From Workflow | This event is triggered when an Inbound Call is abandoned while in the Workflow / IVR |
Abandoned From Queue | This event is triggered when an Inbound Call is abandoned while waiting in the Queue |
To enable the trigger, check the Enabled box
Modify the parameters, which are defined by a set of conditions and actions, as listed below:
Parameters | Key | Values |
---|---|---|
conditions (array) | reference (string) | The reference can be any key available in Webhook Payloads (see table below), using dot notation. For example: campaignId or lead.totalAttempts |
operator (string) | "=" - Equals | |
value (string) | The value is relative to the reference. If the reference is campaignId, the value is the unique Id of the campaign, for example, campaignId=10. If the reference is wrapCode, the value is the unique ID of the wrap code, for example, wrapCode=185. See Additional Notes for more information on where to find campaign or wrap code IDs | |
actions (array) * | action (string) | "webhook", "lead.update.list". |
| parameters (object) | See the table below. |
A Trigger does not require conditions as these work as filters however an action will always be required.
Every action has its own set of accepted parameters:
Action | Description | Parameters | Example |
---|---|---|---|
lead.update.list | This action moves a lead to a specified list within the same campaign. | listId (string) |
JSON
|
webhook | This action dispatches an HTTP request to a specified URL. The payload depends upon the event. | url (string) |
JSON
|
Select Save when completed:
o If the trigger is valid,Trigger has been updated will be displayed:
o If the trigger is invalid, an error will display indicating the issue, examples of these are below:
Error | Example | What to do |
---|---|---|
Invalid JSON format | Check that the parameters field is not empty | |
Actions object error | Check that the action in the parameters is not empty | |
Invalid action parameters | Check the parameters are not empty or incorrectly formatted | |
Error when saving trigger | Check the action is valid, spelled correctly and formatted correctly |
Webhook payloads can be tested and reviewed, see Payload Examples for more information
8. Trigger Examples
Move Leads based on Dial Attempts
In the example below, leads that have been attempted 3 times will be moved into a different list in the same campaign.
{
"conditions": [
{
"reference": "campaignId", //-This value should contain uppercase 'i' for Id. e.g. campaignId
"operator": "=",
"value": "53"
},
{
"reference": "lead.totalAttempts",
"operator": ">=",
"value": "3"
}
],
"actions": [
{
"action": "lead.update.list",
"parameters": {
"lead.listId": "354"
}
}
]
}
Move Lead based on Wrap Code
In the example below, leads that are wrapped with a specific outcome are moved into a different list in the same campaign.
{
"conditions": [
{
"reference": "wrapCode",
"operator": "=",
"value": "185"
},
{
"reference": "campaignId",
"operator": "=",
"value": "1695"
}
],
"actions": [
{
"action": "lead.update.list",
"parameters": {
"listId": "445"
}
}
]
}
Send Webhook on Agent Wrap
In the example below, when an interaction is wrapped by an Agent in two certain campaigns the webhook is triggered to the URL:
{
"conditions": [
{
"reference": "campaignId",
"operator": "in",
"value": "215,223"
}
],
"actions": [
{
"action": "webhook",
"parameters": {
"url": "https://webhook.site/79ee9335-2da8-44dc-8939-fc951325b74f"
}
}
]
}
Send a Webhook on MPIQ Attempt
In the example below, when an MPIQ attempt is made in two certain campaigns the webhook is triggered to the URL:
{
"conditions": [
{
"reference": "campaignId",
"operator": "in",
"value": "215, 223"
}
],
"actions": [
{
"action": "webhook",
"parameters": {
"url": "https://webhook.site/fce087a1-6ae9-42c2-9a28-c1b76df2a05d"
}
}
]
}
9. Webhook Payload Examples
Webhook payloads can differ based on the event type, per the examples below.
Webhook payloads can be tested and reviewed using the following tool:
https://webhook.site/#!/444eec10-542c-43b8-8ab4-fdd2496ce329
The URL displayed on the site should be entered in the URL parameter of the Webhook to send a sample payload when triggered.
More triggers are being developed and will be added in future releases.
Please contact your Account Manager, who can assist you in logging a feature request for evaluation by our Business Solutions team.
Event type | Payload Example (Click to Expand) |
Dialler outcome (Preview) | |
Dialler outcome (Predictive) | |
Agent Wrap | |
MPIQ Attempt | |
Abandoned from Workflow | |
Abandoned in Queue |
11. Additional Notes
Parameters entered into an incomplete trigger will not be saved if the page is navigate away from
If the JSON format is incorrect the trigger cannot be saved.
Campaign ID can be found under Campaigns – Configuration – Select a campaign & note the ID number at the end of the URL:
Wrap code ID can be found under Campaigns – Wrap Codes – Wrap Code Pool
Leads list ID can be found under Campaigns – Leads – Manage Leads Lists: