WhatsApp Bot

🚧

This service is deprecated. It will be deleted in 217 version of SentiOne Automate. Since version 216, WhatsApp bots can be configured in Channels module and the component responsible for communication with Twilio/Vonage is Channels Connector.

General description

Whatsapp Bot is a component responsible for providing bridge between Twilio Whatsapp Business API and SentiOne Automate. It allows to conduct conversations with Automate bots using Whatsapp text messages.

User's messages are being delivered to the application through webhooks technology so that it is important to make sure this component is exposed in a way those webhooks can be delivered.

API

Default port: 5752

Application has got HTTP API which is secured by signing entire payload with secret shared token between Twilio and component.

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

Databases

This application connects to RabbitMQ in order to persist all incoming messages and to guarantee they will be processed even in case of temporary downtime of application.

Communication

This service communicates with the following services:

ApplicationConfig to URLAuth
Twilio APIchatbots.whatsapp-bot.twilio.api-urlToken-based
gatewaychatbots.gateway-api.urlNone

To configure communication you will also need to provide callback URL in Twilio settings. The URL should match the following pattern: https://whatsapp.example.com/twilio. Remember to add /twilio path at the end of the public URL.

Config

Application's config:

chatbots.whatsapp-bot {  
  
  # The url where the application is avaiable publicly
  public-url: "http://whatsapp-bot:5750"
  
  # List of bots  
  bots: [{  
    # Automate's Project id  
    bot-id: "aaaabbbb-4444-5555-6666-ccccddddeeee"  
     # WhatsApp Phone number which acts as inbox  
    number: "+48123456789"  
    # Flag to enable handover protocol  
    handover-enabled: true 
    # override provider/account (optionally)
    provider {
    	type: "twilio-config" # or wassenger-config (obsolete)
      # same credentials as for account configuration below
      account-sid: ""
      auth-token: ""
    }
  }]

	# configuration of default account
  twilio {  
    # Account Sid of Twilio project (can be found here <https://www.twilio.com/console>)  
    account-sid: "Abc"  
    # Auth Token for Twilio project (can be found here <https://www.twilio.com/console>)  
    auth-token: "abcdef"  
    # Twilio API domain  
    api-url: "api.twilio.com"  
  }  
}

Other required configurations:

# actual address for gateway service  
chatbots.gateway-api.url: "<http://host:port>" 

chatbots.messaging {  
  rabbit {  
    hosts: ["HOST:PORT"]  
    username: "USER"  
    password: "PASSWORD"  
  }  
}

Job execution

None

Troubleshooting

Nothing yet.

Additional resources

Twilio

Twilio is third party online service which integrates with official WhatsApp APIs allowing to send and receive text messages to whatsapp users.

Our Bot implementation connects to whatsapp through that provider.

Resources

You can find out more about twilio and it's integration with Whatsapp here:

https://www.twilio.com/whatsapp