Events and Rules

This feature enables team managers to configure events and rules to submit chat-specific data to external systems. An Event is triggered manually by an agent at any time during the chat, whereas a Rule will be automatically triggered depending on the configurations.

To navigate to “Events and Rules”, go to the Admin Console and then click Omnichannel [1] > Groups [2], followed by the “Group” [3] you wish to access.

Within this menu, choose the team you wish to see, by clicking on its “Team Name” [4].

By clicking the Events and Rules [5] page, you can:

Add New Event

  1. Go to Admin Console and click Omnichannel > Groups > the Group you wish to access > Team Name > Events and Rules.
  2. Click Add New Event in the right corner of "Events and Rules".
  3. The following screen appears:
  1. Enter the “Name” of the event [1].
  2. Select one of the following HTTP methods for retrieving and sending data to a server - GET/PUT/POST/PATCH/DELETE [2].
  3. Provide the “URL” whose resources need to be retrieved when the event is triggered [3].
  4. Select the type of response format - JSON/XML/Plain text - in the “Expected Response Format” field [4].
  5. If desired, select the checkbox “Wait for Response” which will disable the re-triggering of the same event until a response is received from the target system [5].
  6. Select the checkbox “Display Response on Chat Console” [6] which will display the response from the target system to the agent within the chat console, as seen below:

Payload

  1. In the “Payload” section, choose a method to send the transmitted data - “Key Value Pair” [7] or “Custom Payload” [8].
  2. If “Key Value Pair” is the selected option, you can:
  • Tick the “Form-encode Request Body” box to generate a form that will encode the parameters sent in the request body [9].
  • Configure the parameters to be sent in the API requests, by clicking Add Param [10]. When the new pop-window is displayed, fill in the fields as described below:
  • Select “Header”, “Query Param” or “Request Body” from the “Pass Through” drop-down list [A].
  • Add a name to the “Parameter” [B].
  • If this parameter must be selected while triggering an event, tick the checkbox “Mandatory Parameter” [C].
  • Select a value from the “Value” drop-down list [D]. If the option “custom param” is chosen, two new fields will be displayed. Select one of the options:
    • Allow Agent to enter value manually - This will allow the agent to enter the values manually before calling an external URL to post the data.
    • Allow Agent to choose from a set of predefined values - This will allow the agent to enter the pre-configured values before calling an external URL to post the data.
  • When finished, click Add [E] to save the parameters.
  • If necessary, on the parent page, use the edit (pencil) and delete icons to modify or delete the parameters.
  1. If you select “Custom Payload”, a new field will be displayed where the payload can be sent in JSON format. In the “Data” field, the parameters entered should start with ‘@@’ and end with curly ‘{}’ brackets.
  1. Click Save Changes to save the configured event. A confirmation message should be displayed upon the successful addition.

Add New Rule

To create a new rule, follow these steps:

  1. Go to the Admin Console and click Omnichannel > Groups > the Group you wish to access > Team Name > Events and Rules.
  2. Click Add New Event in the top-right corner of “Events and Rules”.
  3. The following screen appears:
  1. Enter the “Name” of the event [1].
  2. Select the condition from the “Fire When” drop-down list [2]. The rules will automatically trigger the pre-configured condition. The list includes the following conditions to be allowed in a Rule:
  • Message arrives: The rule is triggered for an inbound message.
  • Inbound message contains: The rule is triggered when an inbound message contains a configured word. If this condition is selected, a text box is displayed. Enter the word (max. 30 characters) in the provided text field.
  • Outbound message contains: The rule is triggered when an outbound message contains a configured word. If this condition is selected, a text box is displayed. Enter the word (max. 30 characters) in the provided text field.
  • Chat is Put On-Hold: The rule is triggered when the chat is put on hold. Select whether to trigger the rule manually, by API, or by the system.
  • Chat off-hold’: The rule is triggered when a chat comes out of the “On-hold” status. Select whether to trigger the rule manually, by API, or by the system.
  • Chat is Closed: The rule is triggered when the chat is completely closed. Select whether to trigger the rule manually, by API, or by the system.
  • Chat assigned: The rule is triggered when a chat is assigned to an agent. Select whether to trigger the rule manually, by API, or by the system.
  • Chat is Flagged: The rule is triggered when the chat is flagged. When selecting this condition, a drop-down list is displayed with the description text (set of the five colors) configured on the system. Select whether to trigger the rule manually or by API.
  • Customer Not Attended: The rule is triggered when the chat is idle for a pre-configured duration. If this condition is selected, a drop-down list with time values such as 5/10/15/20/30/60/90 minutes is displayed. Select the time duration from the drop-down.
  • Logout by User: The rule is triggered when the agent logs out of the chat console manually.
  • Logout by System: The rule is triggered when the agent logs out of the chat console automatically.
  • Chat is Accepted: The rule is triggered when the agent accepts a chat.
  • Agent is Idle: The rule is triggered when the agent is idle (not handling any chat).
  • Chat Created: The rule is triggered automatically when a chat is created. A post request can be made (third-party URL) whenever a chat is created on Omnichannel.
  • Chat Idle: The rule is triggered automatically when a chat is idle. When selecting this condition, a drop-down list with time values such as 5/10/15/20/30/60/90 minutes is displayed.
  • Chat Resume: The rule is triggered automatically when a chat is resumed.
  • Chat is picked up from Queue: The rule is triggered automatically when a chat is picked from the queue.
  • Chat Reopened: The rule is triggered when a chat is reopened. Select whether to trigger the rule manually, by API, or by the system.
  • Message Sent: Rule is triggered when a message is sent.
  1. Select one of the following HTTP methods for retrieving and sending data to a server - GET/PUT/POST/PATCH/DELETE [3].
  2. Provide the “URL” whose resources need to be retrieved when the event is triggered [4].
  3. Select the type of response format - JSON/XML/Plain text - in the Expected Response Form field [5].

Payload

  1. Choose a method to send the part of the transmitted data that is the actual intended message - “Key Value Pair” [6] or “Custom Payload” [7].
  2. If “Key Value Pair” is the selected option, you can:
  • Tick the “Form-encode Request body” box to generate a form that will encode the parameters sent in the request body [8].
  • Configure the parameters to be sent in the API requests, by clicking Add Param [9]. When the new pop-window is displayed, fill in the fields as described below:
  • Select “Header”, “Query Param” or “Request Body” from the “Pass Through” drop-down list [A].
  • Add a name to the “Parameter” [B].
  • Select a value from the “Value” dropdown list [C].
  • When finished, click Add [D] to save the parameters.
  • If necessary, on the parent page, use the edit (pencil) and delete icons to modify or delete the parameters.
  1. If you select “Custom Payload”, a new field will be displayed, where you can send the payload in JSON format. In the “Data” field, the parameters entered should be starting with ‘@@’ and ending with curly ‘{}’ brackets.

  2. Click Save Rule to save the configured rule. A confirmation message should be displayed upon the successful addition.

  3. Rules can also be configured through JavaScript code on the parent window. To do this, toggle the "On/Off JavaScript Rule" in the “Configure Rule” page [10].

In addition to the existing parameters, additional system parameters can be sent by default, as part of every request that goes out of Omnichannel. These are mentioned below:

Parameters Appended to Events

  • event_type : custom_event
  • id (corresponds to Event ID on our system)
  • transactionid (unique trace for every request)
  • chatid

Parameters Appended to Rules

  • event_type : {{fired_when}}
  • id (corresponds to the Rule ID on our system)
  • transactionid (unique trace for every request)
  • chatid

Search Rule or Event

To find a rule or event, enter its name in the search box. The list is filtered and displayed based on the search criteria that have been used.

Edit Rule or Event

Please follow these steps to edit a rule or event:

  1. Click on the pencil icon next to the Event or Rule to display the “Configure Event” or “Configure Rule” page.
  2. Make the required modifications and click Save.

Delete Rule or Event

To delete a rule or event, click on the delete icon next to an Event or Rule. A confirmation message is displayed. Click OK to delete the Event or Rule.