Skip to main content
Version: 5.13

Configure Webex Connect

1. Create Custom Integrations

Create custom Integrations to be able to send/receive Messages to/from your Salesforce Org.

1a. Custom Node

  • In your Webex Connect setup navigate to Assets and then Integrations.
  • Click Add Integraton and then Custom Node
  • Assign the custom node a Name and a Description (for example, Bucher Suter Partner Messaging). In the Node Category field, select Custom Category and provide a name for the category.
  • To enable mTLS for requests sent from Webex Connect to the b+s Salesforce REST Service, ensure that mTLS is enabled in your Salesforce org.

Authorization request

This Request is used to generate an access token. Use the Consumer Key and Consumer Secret of the connected app created during package installation.

  • Request Name: Generate access token
  • Type: POST
  • Resource URL: https://$(SalesforceDomain).my.salesforce.com/services/oauth2/token
  • Click Parse Variables, the variables will be listed below the Resource URL field
  • Configure the SalesforceDomain Parameter
    • Parameter: SalesforceDomain
    • Parameter Value Type: Dynamic
    • Field Name SalesforceDomain
  • Click Add New button in URL Parameters section
    • Parameter: grant_type
    • Parameter Value Type: Static
    • Parameter Value: client_credentials
  • Click Add New button in URL Parameters section
    • Parameter: client_id
    • Parameter Value Type: Dynamic
    • Parameter Value: client_id
  • Click Add New button in URL Parameters section
    • Parameter: client_secret
    • Parameter Value Type: Dynamic
    • Parameter Value: client_secret
  • In the Response section configure the Node Events
    • Node Event: Success
    • Body: HTTP Status
    • Condition: equals
    • Value: 200
    • Node Edge: Success
  • Configure data to be returned in flow session
    • Set Response Type to JSON(application\json)
    • Click Add New button
    • Parameter Name: AccessToken
    • Body: Body
    • Response Path: $.access_token

Web Chat Message request

This Request is used to send the customer message to Salesforce.

  • Request Name: Web Chat Message
  • Type: POST
  • Resource URL: https://$(SalesforceDomain).my.salesforce.com/services/apexrest/cnxbyoott/interactions/v1/message
  • Click Parse Variables, the variables will be listed below the Resource URL field
    • Configure the SalesforceDomain Parameter
      • Parameter: SalesforceDomain
      • Parameter Value Type: Dynamic
      • Field Name SalesforceDomain
  • In Headers section
    • Click Add New button
    • Parameter: Authorization
    • Parameter Value Type: Dynamic
    • Parameter Value: authorization
  • In the Body section
    • Set the body type to JSON (application/json)
    • add Body
{
"channelAddressIdentifier": "$(ChannelAddressIdentifier)",
"endUserClientIdentifier": "$(UserId)",
"deliveryChannel": "appmessaging",
"appId": "$(AppId)",
"threadId": "$(ThreadId)",
"message": $(Message)
}
  • Click Parse button and configure the Body parameters

    • Parameter: ChannelAddressIdentifier

    • Parameter Value Type: Dynamic

    • Field Name ChannelAddressIdentifier

    • Parameter: UserId

    • Parameter Value Type: Dynamic

    • Field Name UserId

    • Parameter: AppId

    • Parameter Value Type: Dynamic

    • Field Name AppId

    • Parameter: ThreadId

    • Parameter Value Type: Dynamic

    • Field Name ThreadId

    • Parameter: Message

    • Parameter Value Type: Dynamic

    • Field Name Message

  • In the Response section configure the Node Events

    • Node Event: Success

    • Body: HTTP Status

    • Condition: equals

    • Value: 200

    • Node Edge: Success

    • Node Event: UnAuthorized

    • Body: HTTP Status

    • Condition: equals

    • Value: 401

    • Node Edge: Error

  • Configure data to be returned in flow session

    • Set Response Type to JSON(application\json)
    • Click Add New button
    • Parameter Name: id
    • Body: Body
    • Response Path: $.message.workItemIds[0]
Additional Prameters

To send additional parameters to Salesforce, you can extend the body payload, e.g. ctiParam1, ctiParam2, ctiParam3. The additionalPramas object is stored in the custom field WxAdditionalParams__c of the Messaging Session record in Salesforce.

{
"channelAddressIdentifier": "$(ChannelAddressIdentifier)",
"endUserClientIdentifier": "$(UserId)",
"deliveryChannel": "appmessaging",
"appId": "$(AppId)",
"threadId": "$(ThreadId)",
"additionalParams": {
"ctiParam1": "$(CtiParam1)",
"ctiParam2": "$(CtiParam2)",
"ctiParam3": "$(CtiParam3)"
},
"message": $(Message)
}
Activate mTLS for Web Chat Message request

To activate mTLS on this custom node, update the port in the Resource URL to 8443. The Resource URL should be formatted as: https://$(SalesforceDomain).my.salesforce.com:8443/services/apexrest/cnxbyoott/interactions/v1/message. Enable the Security Configuration section to upload a Key Store Certificates and activate TLS 1.2 for this node.

Web Chat Attachments request

This Request is used to send the attachments to Salesforce.

  • Request Name: Web Chat Attachments
  • Type: POST
  • Resource URL: https://$(SalesforceDomain).my.salesforce.com/services/apexrest/cnxbyoott/interactions/v1/attachments
  • Click Parse Variables, the variables will be listed below the Resource URL field
    • Configure the SalesforceDomain Parameter
      • Parameter: SalesforceDomain
      • Parameter Value Type: Dynamic
      • Field Name SalesforceDomain
  • In Headers section
    • Click Add New button
    • Parameter: Authorization
    • Parameter Value Type: Dynamic
    • Parameter Value: authorization
  • In the Body section
    • Set the body type to JSON (application/json)
    • add Body
{
"channelAddressIdentifier": "$(ChannelAddressIdentifier)",
"endUserClientIdentifier": "$(UserId)",
"deliveryChannel": "appmessaging",
"appId": "$(AppId)",
"threadId": "$(ThreadId)",
"attachments": $(Attachment)
}
  • Click Parse button and configure the Body parameters

    • Parameter: ChannelAddressIdentifier

    • Parameter Value Type: Dynamic

    • Field Name ChannelAddressIdentifier

    • Parameter: UserId

    • Parameter Value Type: Dynamic

    • Field Name UserId

    • Parameter: AppId

    • Parameter Value Type: Dynamic

    • Field Name AppId

    • Parameter: Attachment

    • Parameter Value Type: Dynamic

    • Field Name Attachment

    • Parameter: ThreadId

    • Parameter Value Type: Dynamic

    • Field Name ThreadId

  • In the Response section configure the Node Events

    • Node Event: Success

    • Body: HTTP Status

    • Condition: equals

    • Value: 200

    • Node Edge: Success

    • Node Event: UnAuthorized

    • Body: HTTP Status

    • Condition: equals

    • Value: 401

    • Node Edge: Error

Activate mTLS for Web Chat Attachments request

To activate mTLS on this custom node, update the port in the Resource URL to 8443. The Resource URL should be formatted as: https://$(SalesforceDomain).my.salesforce.com:8443/services/apexrest/cnxbyoott/interactions/v1/attachments. Eenable the Security Configuration section to upload a Key Store Certificates and activate TLS 1.2 for this node.

Web Chat typing indicator request

This Request is used to send the Typing Indicator request to Salesforce.

  • Request Name: Web Chat Typing Indicator
  • Type: POST
  • Resource URL: https://$(SalesforceDomain).my.salesforce.com/services/apexrest/cnxbyoott/interactions/v1/TypingStartedIndicator
  • Click Parse Variables, the variables will be listed below the Resource URL field
    • Configure the SalesforceDomain Parameter
      • Parameter: SalesforceDomain
      • Parameter Value Type: Dynamic
      • Field Name SalesforceDomain
  • In Headers section
    • Click Add New button
    • Parameter: Authorization
    • Parameter Value Type: Dynamic
    • Parameter Value: authorization
  • In the Body section
    • Set the body type to JSON (application/json)
    • add Body
{
"channelAddressIdentifier": "$(ChannelAddressIdentifier)",
"endUserClientIdentifier": "$(UserId)",
"deliveryChannel": "appmessaging",
"appId": "$(AppId)",
"threadId": "$(ThreadId)"
}
  • Click Parse button and configure the Body parameters

    • Parameter: ChannelAddressIdentifier

    • Parameter Value Type: Dynamic

    • Field Name ChannelAddressIdentifier

    • Parameter: UserId

    • Parameter Value Type: Dynamic

    • Field Name UserId

    • Parameter: AppId

    • Parameter Value Type: Dynamic

    • Field Name AppId

    • Parameter: ThreadId

    • Parameter Value Type: Dynamic

    • Field Name ThreadId

  • In the Response section configure the Node Events

    • Node Event: Success

    • Body: HTTP Status

    • Condition: equals

    • Value: 200

    • Node Edge: Success

    • Node Event: UnAuthorized

    • Body: HTTP Status

    • Condition: equals

    • Value: 401

    • Node Edge: Error

Activate mTLS for Web Chat typing indicator request

To activate mTLS on this custom node, update the port in the Resource URL to 8443. The Resource URL should be formatted as: https://$(SalesforceDomain).my.salesforce.com:8443/services/apexrest/cnxbyoott/interactions/v1/TypingStartedIndicator. Enable the Security Configuration section to upload a Key Store Certificates and activate TLS 1.2 for this node.

1b. Custom Events

Overview

b+s Partner Messaging for Webex Connect forwards the following events triggered by Agent actions in Salesforce:

  • Participant Changed

    The Participant Changed event is triggered when the number of participants on the Salesforce side changes, e.g. when an Agent enters or leaves a chat.

    In addition to the defined Event Id, the following parameters are included in the payload:

    • appId
    • userId
    • threadId
    • messagingSessionId
    • operation (addremove)
    • participantDisplayName (the added/removed participant's display name as defined in Salesforce)
    • participantType* (agent | chatbot)
    • participantRole (Agent | ChatbotSupervisor)

    * in case of supervisor, type is agent

  • End Chat

    The End Chat event is triggered when the Salesforce Agent leaves a chat.

    In addition to the defined Event Id, the following parameters are included in the payload:

    • appId
    • userId
    • threadId
    • messagingSessionId
    • reroute* (true | false)
    • endChatReason* (none | ended | inactive)

    * reroute and endChatReason parameter's values explained:

    reroute

    • true: Chat will be rerouted automatically to an available Salesforce Agent.
    • false: Chat is ended and will not be rerouted.

    endChatReason

    • none: Chat is not ended.
    • ended: The chat is ended by the Agent (or automatically by Salesforce). If the Customer sends a new message, a new Chat will be created in Salesforce and routed to an available Agent.
    • inactive: The chat is set as inactive by the Agent or automatically by Salesforce. The same Chat will be re-routed to an available Agent as soon as the Customer sends a message.

Configuration

Perform these steps for the two Custom Events Participant Changed and End Chat:

  • In your Webex Connect setup navigate to Assets and then Integrations.
  • Click Add Integraton and then Custom Event
  • Give the custom node a Name.
  • Add all parameters described in section 'Overview' and mark them all as mandatory
  • After the Custom Event is created, take a note of the associated Integration ID. This ID is also known as Event Id and a Salesforce Administrator might ask you about these IDs in order to complete Salesforce configuration.

2. Configure Webex Connect Service

2a. Disable preconfigured Rule

  • Open your Service
  • Navigate to the Rules tab
  • disable to preconfigured rule

2b. Generate JWT Authentication credentials

In order to access the Webex Connect APIs Salesforce need a Service ID and a Service Secret.

  • Open your Service
  • Navigate to the API tab
  • Set Auth Type to JWT Token
  • create Authentication Credential
  • Make a note of the service ID and the service secret. Your Salesforce administrator will need these keys together with your Webex tenant to complete the configuration in Salesforce.

3. Flow setup #1: Webex to Salesforce

The sample flow serves to illustrate how the use of custom nodes is intended. This Flow is used to forward messages from the the end-customer's chat widget to Salesforce. Please adapt the flow to the use case in your company.

Sample Flow

Configure Mobile & Web App Event

Flow Condition

Flow Condition

It is recommended to filter out typing_indicator messages so that the first customer message starts the flow session.

Transition Actions

Flow Variables

Use the Nodes Transaction Actions to set Custom Variables as shown on the printscreen. These variables are used to configure the Custom Nodes in the flow.

Stringify Message

This node converts the message sent by the customer into a string to ensure a valid JSON body in the request sent to Salesforce.

Set Retry

Live Chat / in-App Messaging

This node sends a greeting message to the customer.

Authentication retry

The retry nodes are used to configure how often the flow attempts to fetch an access token in the event of an error.

Set Retry Check Retry

Bucher Suter BYOOTT Access token

Configuration

Bucher Suter BYOOTT Access token

Transition Actions

Store the generated Access token into the AccessToken Custom Variable

Bucher Suter BYOOTT Access token

Branch

The branch node is used to assign the message to the corresponding custom request.

Configuration

Message Condition

Typing Indicator Condition

Attachment Condition

Bucher Suter BYOOTT typing ind.

Configuration

Typing Indicator

Bucher Suter BYOOTT message

Configuration

Message

Additional Prameters

If you have configured additional parameters to be passed to Salesforce in your custom node for web chat messages, assign the values in the configuration form

Bucher Suter BYOOTT Attachments

Configuration

Attachments

Receive

The Receive node is used to keep the customer session alive and stores the new messages from the customer.

Configuration

Receive

Transition Actions

Receive

Delay

This node is used to delay the generation of the access token retry. e.g. 1 second

4. Flow setup #2: Salesforce to Webex (Custom-Event triggered)

Messages by Salesforce Agents to a customer are sent to Webex API directly and don't require a Webex Connect Flow. However a flow is needed for the case when one of these Custom Events is triggered:

  • Participant changed
  • Chat is ended

4a. Participant Changed

Sample Flow: Participant Changed

Configure Custom Event

This is the entrypoint for the flow. It is triggered by a custom event sent by b+s resp. Salesforce.

Entrypoint custom event: Participant changed

Branch

The branch node is used to decide which message is sent to the Webex Connect Chat Widget.

Add Condition

Remove Condition

Live Chat / in-App Messaging

This node sends a message to the customer. The content of the message depends on the outcome of the previous Branch node.

4b. Chat Ended

Sample Flow: Chat Ended

Configure Custom Event

This is the entrypoint for the flow. It is triggered by a custom event sent by b+s resp. Salesforce.

Entrypoint custom event: Chat Ended

Branch

The branch node is used to decide which message is sent to the Webex Connect Chat Widget.

Reroute Condition

Live Chat / in-App Messaging

This node sends a message to the customer. The content of the message depends on the outcome of the previous Branch node.