Channels Connector

General description

Channels connector is a component responsible for providing a bridge between different channels and SentiOne Automate. It allows to conduct conversations with Automate bots. It's meant to replace separate "Bot" apps by merging them into one application.

List of supported channels is available here.

API

Default port: 5782

There are default endpoints for monitoring purposes. They are described in Components monitoring section.

Databases

RabbitMQ

The component reads and writes data to queues:

  • automate.webhooks.messenger - used for Facebook's webhooks
  • automate.webhooks.vonage - used for Vonage's webhooks
  • automate.webhooks.twilio - used for Twilio's webhooks

Communication

This service communicates with the following services:

ApplicationConfig to URLAuth
adminchatbots.channels-connector.api.admin-external.urlOTP
Twilio APIchatbots.channels-connector.twilio.api-urlToken-based
Facebook Graph APIchatbots.channels-connector.messenger.facebook-uriToken-based
gatewaychatbots.gateway-api.urlNone
MS Teams APIhttps://graph.microsoft.com
https://login.microsoftonline.com
Token-based
WebChatchatbots.web-chat-api.urlOTP
Thread Coordinatorchatbots.thread-coordinator-api.urlnone
LiveChatchatbots.channels-connector.livechatToken based + webhook secret
Slackchatbots.channels-connector.slackToken-based + webhook secret

Webhooks

WhatsApp

For both WhatsApp by Vonage and WhatsApp by Twilio channels, webhooks URLs are visible on the application's UI in the Channel creation form. Detailed guides on how to integrate Automate with WhatsApp (including setting up webhooks) are available here: Vonage Twilio.

Facebook Messenger

The webhooks URL is https://CHANNELS-CONNECTOR_SERVER_PUBLIC_URL/webhooks/messenger

To register webhooks, you need to go to Facebook Developer website and set this address as Callback URL in Messenger -> Settings -> Webhooks.

Microsoft Teams configuration

Please refer to configuration documentation Microsoft Teams.

LiveChat configuration

Please refer to configuration documentation LiveChat.

Config

Application's config

chatbots.channels-connector {

	# Public address of channels connector. It's required for some channels e.g. Twilio
  public-url: "https://CHANNELS-CONNECTOR_SERVER_PUBLIC_URL" 
  expose-exception: false

  api {
    admin-external {
      url: "http://ADMIN_URL/api/external"
      otp-secret: "PUT_SECRET_HERE"
    }
  }

  vonage: {
    enabled: true
    message-timeout: 15s
    message-interval: 500ms
  }

  twilio: {
    enabled: true
    message-timeout: 15s
    handoverEnabled: true
    //api-url: "api.twilio.com"
  }

  messenger: {
    enabled: true
    message-timeout: 15s
    facebook-uri: "https://graph.facebook.com"
    typing-time: 1s
    
    # Defining app-id, app-secret and webhook-token enables Facebook Messenger Channel (OAuth)
    app-id: "XXX"
    app-secret: "XXX"
    webhook-token: "XXX"
  }


  
  # Defining this section enables Ms Teams Channel (OAuth)
  ms-teams {
    enabled: true
    private-key: "XXX",
    client-secret: "XXX"
    tenant-id: "XXX"
    client-id: "XXX"
    // Optional, available since v227
    proxy: {
    	host: "hostname.com" // without protocol and port, can be IP address
      port: 3128
      username: "user" // optional, needed if Proxy requires Authentication
      password: "password // optional, needed if Proxy requires Authentication
    }
  }
  
  # Defining this section enables LiveChat (OAuth)
  livechat {
    enabled: true
    client-id: "xxx"
    client-secret: "xxx"
    webhook-secret: "xxx"
    
    # Proxy is optional
    proxy {
      host: "PROXY_HOST"
      port: PROXY_PORT
      username: "PROXY_USER"
      password: "PROXY_PASSWORD"
    }
  }
  
  # Defining this section enables WebChat
  web-chat {
    enabled: true
  }
}

Other required configurations:

chatbots.messaging {  
  rabbit {  
    hosts: ["HOST:PORT"]  
    username: "USER"  
    password: "PASSWORD"  
  }  
}
chatbots.channels {
  channel-data-encryption-key: "XXX" # Key length should be 256 bits (32 characters)
  
  channels-connector-url: "http://CHANNELS-CONNECTOR_SERVER_PUBLIC_URL"
  vonage-repeat-hmac-key: "XXX" # By default it is equal to Listen's onpremise hookServer.vonage.repeatHmacKey  
  hooks-server-url: "URL" # Optional 
}
chatbots.web-chat-api {
  url: "http://host:port"
  otp-secret: "XXX"
}

Job execution

## RefreshChannelsSubscriptions

This cron job is responsible for periodically refreshing channels subscriptions if it's needed.

Troubleshooting