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). This trigger is currently only available by request, please contact your Account Manager for further information.

More triggers are being developed and will be added in future releases. If you have an idea for a trigger please contact your Account Manager, who can assist you in logging a feature request for evaluation by our engineering team. 


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, please check 

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

Note: 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. 

  1. Select Integration – Triggers - + to add a new trigger 

  2. Name your trigger & select the event type:
    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 

3. Select Create & the Trigger Configuration page will launch 

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

"=", ">", "<", ">=", "<=", "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. 

actions (array) 

action (string) 

"webhook", "lead.update.list". 

 

parameters (object) 

See the table below. 

 

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

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

"action": "webhook", 

"parameters": { 

"url": "https://your.webservice.com

·         Select Save when completed 

o    If the trigger is valid you will see Trigger has been updated  

o    If the trigger is invalid you will see JSON is Invalid 


8. Trigger Examples

In the example below, leads that have been attempted 3 times will be moved into a different list in the same campaign.

In the example below, leads that are wrapped with a specific outcome are moved into a different list in the same campaign. 


9. Create a New Webhook

·         Select Integration – Triggers - + to add a new trigger 

·         Name your trigger & select the event type from: 

o    Dialler Call Outcome (Predictive) 

o    Dialler Call Outcome (Preview) 

·         Select Create & the Trigger Configuration page will launch 

·         Modify the parameters, referencing the URL where your webhook will be hosted 

·         Select Save when completed 

o If the trigger is valid you will see Trigger has been updated  

o If the trigger is invalid you will see JSON is Invalid 


10. Webhook Payloads

Webhook payloads can differ based on the event type, per the examples below.

More payloads 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 engineering team. 

Event type 

Payload 

Dialler outcome (Preview) 

{ 
    "type": "outbound.lead.outcome.preview", 
    "payload": { 
        "timestamp": "2020-07-08 03:21:58", 
        "agentInteractionId": "2623", 
        "wrapCode": "6", 
        "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" 
                } 
            } 
        } 
    } 
} 
CODE

Dialler outcome (Predictive) 

{ 
    "type": "outbound.lead.outcome.predictive", 
    "payload": { 
        "timestamp": "2020-07-08 03:29:42", 
        "agentInteractionId": "2624", 
        "wrapCode": "6", 
        "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"} 
                    		} 
                } 
            } 
        } 
    } 
} 
CODE

Agent Wrap

{
  "type": "agent.wrap",
  "payload": {
    "interactionType": "call.manual", // call.inbound, call.outbound, call.converted_to_outbound, email, chat
    "timestamp": "2021-09-15 22:59:55",
    "agentInteractionId": "3130",
    "wrapCode": "4",
    "wrapDescription": "Busy",
    "callbackDate": null,
    "agentId": "1002",
    "leadId": null,
    "campaignId": "8",
    "durations": { // Seconds
      "preview": 0,
      "dial": 3,
      "interaction": 41,
      "talk": 38,
      "wrap": 0
    }
  }
} 
CODE


11. Additional Notes 

  • Parameters entered into an incomplete trigger will not be saved if you navigate away from the page 

  • 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