These docs are for v0.0.1. Click to read the latest docs for v1.0.62.

Adding Context Data for Messaging

Capturing Context Data in Messaging SDK

To send Context Data as metadata for Messaging interactions use the following steps as part of implementing the Messaging SDK:

  1. Provide an object that implements the MessageModifierDelegate interface
    a. On function beforeSend you have to reference the Message object
    b. You can change the metadata in the Message object and return the Message object
  2. Pass the Delegate to the Messaging SDK via setMessageModifierDelegate()
val msgDelegate = object : MessageModifierDelegate {
    override fun beforeSend(p0: ConversationDetails, p1: Message): Message {
        p1.metadata = getMessageMetaData()
        return p1
    }

    override fun beforeNotification(p0: String, p1: Message): Message? {
        return p1
    }

    override fun beforeDisplay(p0: ConversationDetails, p1: Message): Message? {
        return p1
    }

}
AvMessagingSdk.setMessageModifierDelegate(msgDelegate)

Some use cases for Context Data:

  • Customer Type - Bronze, Silver, Gold
  • Shopping Cart Full - True, False
  • Last Page Visited - Home, Shop, About Us
  • Last Item Purchased - Phone, Computer, Camera

Using Context Data Rules to Match Attributes in Administration

Now that you are passing Context Data as metadata with Messaging interactions, you are ready to start consuming that Context Data for your Messaging channel and matching it to Attributes so your Messaging interactions can be routed to appropriate Agents.

  1. Navigate to Administration as part of your Avaya Experience Platform™ tenant
  2. Open the "Business Rules > Context Data Rules" section of the Administration
  3. Click "Add Rule"

  1. On the "New Context Rule" page, give the new Context Data Rule a name
  2. Give the new Context Data Rule "Rule Conditions" in the form of "key":"value" pairs, making sure the "key" matches the "key" you defined in "Capturing Context Data in Messaging SDK" steps earlier
  3. Add the Attributes you would like to apply every time the Context Data matches with the Context Data sent with the Messaging interaction

  1. Once you are happy with all of the information, click "Save"

  1. You should see your new Context Data Rule saved and ready to be used by your Messaging channel
  2. Navigate to "Channels > Messaging" and open the Pre-Routing Configuration for the channel by clicking the "Cog"

  1. Once you have opened the Pre-Routing Configuration for the Messaging channel, turn on the "Apply Context Data Matching" toggle to enable Context Data Matching
  2. Move the Context Data Rule you have created from the left table to the right to enable it as part of the Pre-Routing Configuration

  1. Once you are happy with the Pre-Routing Configuration, click "Save"

Now there will be a detection of your newly created Context Data Rule when any new Messaging interaction comes to Avaya Experience Platform™.