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: 

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

CODE
{
    "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. 

CODE
{
    "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:

CODE
{
    "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:

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

Answering Machine Outcome
CODE
{
  "type": "outbound.lead.outcome.preview",
  "payload": {
    "timestamp": "2024-05-03T06:56:20+0000",
    "agentInteractionId": "181334",
    "wrapCode": "6",
    "callerNumber": "+612XXXXXXXX",
    "calledNumber": "+614XXXXXXXX",
    "activityId": "327997",
    "callbackDate": null,
    "agentId": "1093",
    "leadId": "131413",
    "campaignId": "20161",
    "lead": {
      "completed": false,
      "totalAttempts": "1",
      "listId": "20583",
      "customerKey": "258376",
      "nextAttempt": "2024-05-03T07:11:20+0000",
      "statusCode": "6",
      "phones": {
        "1": {
          "phone": "+614XXXXXXXX",
          "completed": false
        }
      },
      "outcomes": {
        "6": {
          "count": "1",
          "description": "Answer Machine"
        }
      }
    }
  }
}
Answer Completed Outcome
CODE
{
  "type": "outbound.lead.outcome.preview",
  "payload": {
    "timestamp": "2024-05-03T06:57:17+0000",
    "agentInteractionId": "181335",
    "wrapCode": "209",
    "callerNumber": "+612XXXXXXXX",
    "calledNumber": "+614XXXXXXXX",
    "activityId": "327998",
    "callbackDate": null,
    "agentId": "1093",
    "leadId": "131414",
    "campaignId": "20161",
    "lead": {
      "completed": true,
      "totalAttempts": "1",
      "listId": "20583",
      "customerKey": "258377",
      "nextAttempt": "2024-05-03T08:56:20+0000",
      "statusCode": "209",
      "phones": {
        "1": {
          "phone": "+614XXXXXXXX",
          "completed": false
        }
      },
      "outcomes": []
    }
  }
}

Dialler outcome (Predictive) 

Answering Machine Outcome (Attempt)
CODE
 {
  "type": "outbound.lead.outcome.predictive",
  "payload": {
    "timestamp": "2024-05-03T06:41:08+0000",
    "agentInteractionId": null,
    "wrapCode": "6",
    "callerNumber": null,
    "calledNumber": null,
    "activityId": null,
    "callbackDate": null,
    "agentId": null,
    "leadId": "131410",
    "campaignId": "20161",
    "lead": {
      "completed": false,
      "totalAttempts": "1",
      "listId": "20583",
      "customerKey": "258373",
      "nextAttempt": "2024-05-03T06:56:08+0000",
      "statusCode": "6",
      "phones": {
        "1": {
          "phone": "+614XXXXXXXX",
          "completed": false,
          "count": "1",
          "outcomes": {
            "6": {
              "count": "1",
              "statusCode": "Answer Machine"
            }
          }
        }
      }
    },
    "callId": "324424"
  }
}
Answered and Completed Outcome
CODE
{
  "type": "outbound.lead.outcome.predictive",
  "payload": {
    "timestamp": "2024-05-03T06:41:43+0000",
    "agentInteractionId": "181332",
    "wrapCode": "209",
    "callerNumber": "+612XXXXXXXX",
    "calledNumber": "+614XXXXXXXX",
    "activityId": "327995",
    "callbackDate": null,
    "agentId": "1093",
    "leadId": "131411",
    "campaignId": "20161",
    "lead": {
      "completed": true,
      "totalAttempts": "1",
      "listId": "20583",
      "customerKey": "258374",
      "nextAttempt": "2024-05-03T08:41:09+0000",
      "statusCode": "209",
      "phones": {
        "1": {
          "phone": "+614XXXXXXXX",
          "completed": false,
          "count": "1",
          "outcomes": null
        }
      }
    }
  }
}

Agent Wrap

Manual Outbound Call Type
CODE
{
  "type": "agent.wrap",
  "payload": {
    "interactionType": "call.manual",
    "timestamp": "2024-05-03T06:29:19+0000",
    "agentInteractionId": "181329",
    "wrapCode": "6",
    "wrapDescription": "Answer Machine",
    "callerNumber": "+612XXXXXXXX",
    "calledNumber": "+614XXXXXXXX",
    "activityId": "327992",
    "callbackDate": null,
    "agentId": "1093",
    "leadId": null,
    "campaignId": "1196",
    "lead": null,
    "durations": {
      "preview": 0,
      "dial": 6,
      "interaction": 20,
      "talk": 7,
      "wrap": 7
    }
  }
}

Inbound Call Type
CODE
{
  "type": "agent.wrap",
  "payload": {
    "interactionType": "call.inbound",
    "timestamp": "2024-05-06T06:15:19+0000",
    "agentInteractionId": "181347",
    "wrapCode": "35",
    "wrapDescription": "Query",
    "callerNumber": "+614XXXXXXXX",
    "calledNumber": "612XXXXXXXX",
    "activityId": "328015",
    "callbackDate": null,
    "agentId": "1227",
    "leadId": null,
    "campaignId": "1017",
    "lead": null,
    "durations": {
      "preview": 0,
      "dial": 0,
      "interaction": 59,
      "talk": 54,
      "wrap": 5
    }
  }
}
Outbound Preview Call Type
CODE
{
  "type": "agent.wrap",
  "payload": {
    "interactionType": "call.outbound",
    "timestamp": "2024-05-03T06:32:43+0000",
    "agentInteractionId": "181330",
    "wrapCode": "209",
    "wrapDescription": "Complete",
    "callerNumber": "+612XXXXXXXX",
    "calledNumber": "+614XXXXXXXX",
    "activityId": "327993",
    "callbackDate": null,
    "agentId": "1093",
    "leadId": "131406",
    "campaignId": "20161",
    "lead": {
      "completed": true,
      "totalAttempts": "1",
      "listId": "20583",
      "customerKey": "258369",
      "nextAttempt": "2024-05-03T08:32:14+0000",
      "statusCode": "209",
      "phones": {
        "1": {
          "phone": "+614XXXXXXXX",
          "completed": false
        }
      },
      "outcomes": []
    },
    "durations": {
      "preview": 6,
      "dial": 6,
      "interaction": 29,
      "talk": 7,
      "wrap": 10
    }
  }
}
Predictive Outbound Call Type
CODE
{
  "type": "agent.wrap",
  "payload": {
    "interactionType": "call.outbound",
    "timestamp": "2024-05-03T06:35:46+0000",
    "agentInteractionId": "181331",
    "wrapCode": "209",
    "wrapDescription": "Complete",
    "callerNumber": "+612XXXXXXXX",
    "calledNumber": "+614XXXXXXXX",
    "activityId": "327994",
    "callbackDate": null,
    "agentId": "1093",
    "leadId": "131409",
    "campaignId": "20161",
    "lead": {
      "completed": true,
      "totalAttempts": "1",
      "listId": "20583",
      "customerKey": "258372",
      "nextAttempt": "2024-05-03T08:35:15+0000",
      "statusCode": "209",
      "phones": {
        "1": {
          "phone": "+614XXXXXXXX",
          "completed": false,
          "count": "1",
          "outcomes": null
        }
      }
    },
    "durations": {
      "preview": 0,
      "dial": 0,
      "interaction": 20,
      "talk": 12,
      "wrap": 8
    }
  }
}

MPIQ Attempt

MPIQ Attempt
CODE
{
  "type": "mpiq.attempt",
  "payload": {
    "mpq_id": "1",
    "activity_id": "327999",
    "campaign_id": "20183",
    "threshold_type": "position",
    "ivr_queue_object_id": "1677",
    "status": "calling",
    "attempts": "0",
    "max_attempts": "2",
    "amd_enabled": "0",
    "callback_phone": "+614XXXXXXXX",
    "callback_announcement": "37",
    "created_at": "2024-05-03 07:15:14",
    "outcome_type": "success"
  }
}

Abandoned from Workflow

Call Abandoned in Workflow
CODE
{
  "type": "inbound.workflow.abandon",
  "payload": {
    "timestamp": "2024-05-03T07:20:23+00:00",
    "activityId": "328000",
    "campaignAbandonedWithin": "0",
    "timeInWorkflow": 16,
    "numberCalled": "612XXXXXXXX",
    "callersNumber": "+614XXXXXXXX",
    "workflowActivityFieldData": {
      "IPS_IH_SO": {
        "key": "IPS_IH_SO",
        "value": "1",
        "title": "ipSCAPE IH Select Option",
        "type": "IVR_OPTION"
      }
    }
  }
}

Abandoned in Queue

Call Abandoned in Queue
CODE
{
  "type": "inbound.queue.abandon",
  "payload": {
    "timestamp": "2024-05-06T05:33:28+00:00",
    "activityId": "328011",
    "campaignId": "1017",
    "timeInWorkflow": 24,
    "timeInQueue": 4,
    "totalWaitTime": 28,
    "numberCalled": "612XXXXXXXX",
    "callersNumber": "+614XXXXXXXX",
    "workflowActivityFieldData": {
      "IPS_IH_SO": {
        "key": "IPS_IH_SO",
        "value": "2",
        "title": "ipSCAPE IH Select Option",
        "type": "IVR_OPTION"
      }
    }
  }
}

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.