Skip to main content
Skip table of contents

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: 

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).

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).

  • 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
">" - Greater than
"<" - Less than
">=" - Equal to or greater than
"<=" - Equal to or less than
"in"  - Is in

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
{
"action": "lead.update.list", 

"parameters": 
  { 
  "listId": "10" 
  } 
}

webhook 

This action dispatches an HTTP request to a specified URL. The payload depends upon the event. 

url (string) 

JSON
{
"action": "webhook", 

"parameters": 
  { 
  "url": "https://your.webservice.com" 
  } 
}
  • 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.

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. 

Send Webhook on Agent Wrap

In the example below, when an interaction is wrapped by an Agent the webhook is triggered to the URL:


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

Dialler outcome (Preview) 

CODE
{ 
    "type": "outbound.lead.outcome.preview", 
    "payload": { 
        "timestamp": "2020-07-08 03:21:58", 
        "agentInteractionId": "2623", 
        "wrapCode": "6", 
        "callerNumber": "+61XXXXXXXXX",
        "calledNumber": "+61XXXXXXXXX",
        "activityId": "78913",
        "callbackDate": null, 
        "agentId": "1002", 
        "leadId": "240595", 
        "campaignId": "11", 
        "lead": { 
            "completed": false, 
            "totalAttempts": "1", 
            "listId": "203", 
            "customerKey": "10034", 
            "nextAttempt": "2020-07-08 09:21:59", 
            "statusCode": "6", 
            "phones": { 
                "1": { 
                    "phone": "+61410000000", 
                    "completed": false 
                } 
            }, 
            "outcomes": { 
                "6": { 
                    "count": "1", 
                    "description": "Answering Machine" 
                } 
            } 
        } 
    } 
} 

Dialler outcome (Predictive) 

CODE
{ 
    "type": "outbound.lead.outcome.predictive", 
    "payload": { 
        "timestamp": "2020-07-08 03:29:42", 
        "agentInteractionId": "2624", 
        "wrapCode": "6", 
        "callerNumber": "+61XXXXXXXXX",
        "calledNumber": "+61XXXXXXXXX",
        "activityId": "78913",
        "callbackDate": null, 
        "agentId": "1002", 
        "leadId": "240568", 
        "campaignId": "8", 
        "lead": { 
            "completed": false, 
            "listId": "200", 
            "customerKey": "10000005", 
            "nextAttempt": "2020-07-08 06:29:43", 
            "statusCode": "6", 
            "phones": { 
                "1": { 
                    "phone": "+61410000000", 
                    "completed": false, 
                    "count": "1", 
                    "outcomes": { 
                        "6": { 
                            "count": "1", 
                            "statusCode": "Answering Machine"} 
                    		} 
                } 
            } 
        } 
    } 
} 

Agent Wrap

CODE
{
  "type": "agent.wrap",
  "payload": {
    "interactionType": "call.manual",
    "timestamp": "2023-11-07 05:36:36",
    "agentInteractionId": "76389",
    "wrapCode": "6",
    "wrapDescription": "Answer Machine",
    "callerNumber": "+61XXXXXXXXX",
    "calledNumber": "+61XXXXXXXXX",
    "activityId": "78913",
    "callerNumber": "+61XXXXXXXXX",
    "calledNumber": "+61XXXXXXXXX",
    "activityId": "78913",
    "callbackDate": null,
    "agentId": "22080",
    "leadId": null,
    "campaignId": "20150",
    "durations": {
      "preview": 0,
      "dial": 10,
      "interaction": 20,
      "talk": 7,
      "wrap": 3
    }
  }
}


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:

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.