- 12 Dec 2024
- 5 Minutes to read
- Print
- DarkLight
23.3.6. Event Routing
- Updated on 12 Dec 2024
- 5 Minutes to read
- Print
- DarkLight
What is Event Routing?
Event routing is the ability to trigger a routing policy based on an event happening on the Natterbox platform such as a Message is sent by a User. These are currently only supported for Digital messaging but will be expanded to other areas of the Natterbox product in the future.
When an event has been set up within a Data Analytics routing policy it will activate this policy when the event is triggered allowing you to do actions based on this event. For example, you may want to create a Salesforce record every time a message is sent containing the message content.
Setting up an Event Routing Policy
Events are available in Data Analytics routing policy in the form of a start component labelled “Event”.
To start setting up an Event Routing Policy you will first need to create a Data Analytics routing policy and then hover over the Start section to add an Event container.
You will now have an empty event within your Routing Policy.
Selecting the Event will display the app on the right hand side window.
To select an Event press the “Select Event” button
You will now see a list of events that you can select from, for each Event container only one event can be selected at a time but you can add multiple event containers to a policy.
Selecting an Event and pressing Save will close this screen and the event container will now be updated with the label of the event you selected. See below as an example.
Now you have created an event you can now configure the rest of your policy for what you would like to happen when this event is triggered.
An example solution is to have the message contents stored in Salesforce as an Activity when a message is sent or received - see our solution guide that can be found here.
Events
Below is a list of all the events that are available for routing, please note that not all events can be triggered directly by a User action and some events are triggered by the Natterbox platform such as message deletions.
Event Category | Event Name | Event Description |
---|---|---|
Conversation | A Digital Conversation is created. | |
A Digital Conversation is updated. | ||
A Digital Conversation is deleted. | ||
Message | A Digital Message is updated. | |
A Digital Message is created. | ||
A Digital Message is deleted. | ||
Wrap-Up | A Digital Wrap-Up is created. | |
A Digital Wrap-Up is updated. | ||
A Digital Wrap-Up is deleted. | ||
Message Dispatch | An inbound message has been received and is being routed, this does not account for if a message is blocked or unable to be delivered. | |
An outbound message has been sent and is being routed, this does not account for if a message is blocked or unable to be delivered. | ||
An inbound message has been received and routed to a conversation. | ||
An outbound message has been sent and routed to the carrier, this does not guarantee delivery but indicates that the message has been sent on to the carrier for delivery. | ||
An inbound message has been received and it was deleted whilst being routed, most likely to due a block policy. | ||
An outbound message has been received and it was deleted whilst being routed, most likely to due a block policy. |
Retries
An Event will retry if this is routed through a retry app, when an event is set up to be retried it is added to a queue that will retry at increasing intervals until it has successfully completed (meaning it hasn’t routed through a retry app again) or has reached the set duration expiry.
When adding an event to a data analytics routing policy you can also configure the duration this will remain in the retry queue (in hours)
In the above example this will remain in the retry queue for 24 hours until either the event has completed or until 24 hours have passed.
Event Macros
Event macros are slightly different to regular Natterbox macros in that they are dependent on the context of which event has fired and what data is available within that Event, typically this is based around the category the type of Event belongs to. For example in a Wrap-Up based event this will not have data around the date/time of a specific message but a Message event will have this data.
This means that we need to consider the type of event that has been triggered to identify what data we have available to us.
See below for more information on the different categories of events and the sorts of data that is available.
Conversation Events
Event Data | Data Description | Macro |
---|---|---|
Conversation Id | The unique identifier of the conversation. | $(Payload_Event.event.conversationId) |
Status | The current status of the conversation. | $(Payload_Event.event.status) |
Message Events
Event Data | Data Description | Macro | |
---|---|---|---|
Message Info | Channel Type | The channel type of the message. For example, “SMS” or “WhatsApp”. | $(Payload_Event.event.messageInfo.channelType) |
Message payload | The contents of the message itself that was sent. | $(Payload_Event.event.messagePayLoad.textMessage.text) | |
Digital Channel Address | The digital channel address, sometimes referred to as the From Address. This is typically the Agents address. | $(Payload_Event.event.messageInfo.digitalChannelAddress) | |
Identity Address | The identity address, sometimes referred to as the To Address. This is typically the Customer or Contacts address that the agent is conversing with. | $(Payload_Event.event.messageInfo.identityAddress) |
Message Dispatch
Event Data | Data Description | Macro | |
---|---|---|---|
User Id | The Natterbox User Id the message relates to. | $(Payload_Event.event.userId) | |
Text Payload | The contents of the message being sent or received. | $(Payload_Event.event.textPayload) | |
Digital Channel | Address | The address of the digital channel for the conversation, this will be the address that the message is sent from an Agent or the address that the message is sent to from a contact. | $(Payload_Event.event.digitalChannelGroup.digitalChannel.address) |
Channel Type | The channel type the message was sent on. (SMS etc.) | $(Payload_Event.event.digitalChannelGroup.channelType) | |
Identity | Address | The address of the identity the message was sent to. | $(Payload_Event.event.identity.address) |
Channel Type | The channel type the message was sent on. (SMS etc.) | $(Payload_Event.event.identity.channelType) | |
Content Disposition | Text Size | The character limit of the message. | $(Payload_Event.event.contentDisposition.textSize) |
Image Count | The amount of images sent in the message. | $(Payload_Event.event.contentDisposition.imageCount) | |
Audio Count | The amount of audio files sent in the message. | $(Payload_Event.event.contentDisposition.audioCount) | |
Video Count | The amount of videos sent in the message. | $(Payload_Event.event.contentDisposition.videoCount) | |
Other Count | The amount of other types of files sent in the message. | $(Payload_Event.event.contentDisposition.otherCount) |
Wrap-Up Events
Event Data | Data Description | Macro | |
---|---|---|---|
Created Date | The created date of the Wrap-Up. | $(Payload_Event.event.createdDate) | |
Modified Date | The date the Wrap-Up was last modified. | $(Payload_Event.event.modifiedDate) | |
Start Date | The date of the first message in the Wrap-Up. | $(Payload_Event.event.startDate) | |
End Date | The date of the last message in the Wrap-Up. | $(Payload_Event.event.endDate) | |
Subject | The subject of the Wrap-Up. | $(Payload_Event.event.subject) | |
Notes | The notes on the Wrap-Up. | $(Payload_Event.event.notes) | |
Statistics | All Sent Total | The total sent messages in the Wrap-Up. | $(Payload_Event.event.statistics.allSentTotal) |
Text Messages Sent | The total text messages sent in the Wrap-Up. | $(Payload_Event.event.statistics.textMessagesSemt) | |
Audio Sent | The total audio files sent in the Wrap-Up. | $(Payload_Event.event.statistics.audiosSent) | |
Images Sent | The total images sent in the Wrap-Up. | $(Payload_Event.event.statistics.imagesSent) | |
Videos Sent | The total videos sent in the Wrap-Up. | $(Payload_Event.event.statistics.videosSent) | |
All Received Total | The total messages received in the Wrap-Up. | $(Payload_Event.event.statistics.allReceivedTotal) | |
Text Messages Received | The total text messages received in the Wrap-Up. | $(Payload_Event.event.statistics.textReceived) | |
Audio Received | The total audio files received in the Wrap-Up. | $(Payload_Event.event.statistics.audiosReceived) | |
Images Received | The total images received in the Wrap-Up. | $(Payload_Event.event.statistics.imagesReceived) | |
Videos Received | The total videos received in the Wrap-Up. | $(Payload_Event.event.statistics.videosReceived) | |
Average User Response | The average response time of the User in the Wrap-Up. | $(Payload_Event.event.statistics.averageUserResponseSeconds) | |
Average Contact Response | The average response time of the Contact in the Wrap-Up. | $(Payload_Event.event.statistics.averageContactResponseSeconds) |
FAQ
What minimum Natterbox Salesforce package version must I be on?
It is typically recommended to always be on the latest stable version, but the minimum version for the Digital Routing Policies feature is 1.316. More information can be found here.