Instant - WhatsApp Triggers

What is a WhatsApp Trigger

   A WhatsApp trigger is invoked every time there is a WhatsApp outgoing or incoming interaction.

The trigger will execute its actions if the defined conditions are met. Here are few applications of WhatsApp triggers:

  • displaying Screen Pop-up that provides value added information

  • opening custom browser web pages 

WhatsApp triggers are composed of conditions and actions. This section explains how to build conditions and the available actions for the WhatsApp channel.

To create a trigger go on Tools → Triggers, click on + button, give a name trigger and choose like channel Whatsapp Connector

 

WhatsApp trigger conditions

A condition for the WhatsApp channel is constructed by using properties like Account, Interaction or Message, an operator and a value.  

There are two types of conditions: 

  • Meet all these conditions: the overall condition will be true only if all the conditions are true.

  • Meet any of these conditions: the overall condition will be true if at least one of the conditions is true. 

It is possible to specify more complex conditions by using both types: in this case, the result is true if both conditions are true.

The condition will always return true if you do not define any condition. In this case, the specified actions will always be executed.

You can use the following fields and operators to build condition statements:

Fields

Operators

Values

Fields

Operators

Values

Account

Equals to

Not equals to

  • Select from list (the Account must be already existing)

Interaction

Equals to

Not equals to

  • Opened

  • Closed

Message

Equals to

Not equals to

  • Accepted

  • Rejected

  • Incoming

  • Outgoing

WhatsApp trigger actions

WhatsApp trigger actions are functions executed when the defined WhatsApp trigger conditions are true.

Custom variables must be defined under Tools → Variables then you can set the values in the dialplan.

The following are the actions that can be triggered:

URL Forward

URL forward is used to make an HTTP GET/POST/PUT/DELETE request:

Information about the call will be passed as POST parameters or URL query parameters, depending on which HTTP method you've configured.

You can also use Motion standard variables or custom variables to pass information to the 3rd party application.  

Browser

Browser action is used to display screen popup or open a URL in a web browser for agents logged in the web interface.

Agents must be logged in the Motion Omni Desktop Interface for the actions to run.

There are 2 types of Browser Actions:

  • Popup

  • CTI URL

Popup

Popup action is used to display a customizable screen popup for agents logged in Motion omni desktop interface.

You must first create a template (Tools → Templates) with information you want to be displayed for agents. You can also use standard and custom variables in your template to customize the displayed content based on the values of the variables set during the interaction. 

CTI URL

CTI URL action is used to open a specified URL in a browser New Tab or New Window (Location).  

It can be used to open a website, your custom CRM url or integrate with any other web application.

You can use standard or custom variables in the URL query string to pass information to the web application that can be useful for processing its logic:

  • If the Event Variables field is set to Yes, the string in the URL field is merged with all the available interaction type values (pay attention that it add to the URL string the complete variables list: it is not recommended unless for evaluation purposes).

  • If the Event Variables field is set to No (suggested value), only the variables inserted in the URL field are used.

If the Location is New Agent Dashboard Tab, it is possible to set the Tab Title the Agents will see. 
In the following example, variables in bold are Motion standard variables and those red are custom variables:
http://ip-address/cti/index.html?CALLID={{uniqueid}}&CALLER={{calleridnum}}&QUEUE={{queue}}&ORDER={{ORDERNUM}}&STATUS={{ORDERSTAT}}

Tip: remember to set the Event Variables to No

Script

The Script action allows you to define which script must be run when the trigger is started:

Fill the the Script form as follows:

  • Type: e.g. curl, bash, or other

  • Info: an optional script description

  • Script: the path of the script to be executed