Skip to main content

Botpress Integration - HITL & WhatsApp

This documentation is based on the integrations possible in the vCX Platform and does not warrant that the external bot studios will work as changes in their architecture are beyond our control. It is our best effort to ensure that the connectivity works

Botpress Setup and WhatsApp Integration

After you have set up your bot in Botpress, enable the WhatsApp Integration

For vCX to work with Botpress, your WhatsApp Integration has to be in manual mode as shown below. Automated WhatsApp configuration is made, has to be deleted and configured manually

image.pngimage.png

There are two methods to configure your WhatsApp
1. Using the Automated Setup
2. Using Facebook App
Botpress and vCX support these methods. However, for this integration to work, Botpress has to be setup in manual mode

Head to over vCX and log into your account. Once in your account, click on Settings -> My Plan -> Integrations

Manual Method

image.png

To setupset it up using manual mode, head over to https://developers.facebook.com/docs/whatsapp/cloud-api/get-started/ OR follow our document here

Once you have set up your phone number and token secured. Subscribe vCX Webhook on the developer portal to start receiving incoming messages. To do so, ensure the Manual option is turned ON in the integration pane for WhatsApp in vCX

From the screen copy the webhook and token and subscribe to Messaging from META developer port webhook

image.pngimage.png

Update all the values from your App and the token in vCX configuration - Do keep them secure as they need to be added to Botpress as well. This completes the setup in vCX for WhatsApp. You can now receive and send chats in vCX

Automated Embedded Signup

Instead of the manual method, the embedded signup method is the most convenient as it provides a step-by-step workflow to complete the whole process

To start, turn off the manual mode and click on Connect to get the embedded sign-up screen. this is a facebook.com link that will guide you through the whole process

image.png

Once you have completed the process, your WhatsApp API will be generated and the integration will show complete
The Connect button will be displayed as "Show Details"

image.png

clicking on Show Details will reveal your WhatsApp credentials. copy the credentials to Botpress to complete your setup in Botpress

image.png

Now your Botpress can send messages via the bot to the user, but is still not receiving messages from the user nor is sending the bot response to vCX. To do so, follow the below steps

Select Bot Integration and select WhatsApp Integration

image.png

image.png

From Botpress, copy the webhook from the WhatsApp Integration and paste it into the Botpress WhatsApp Webhook URL section

If you have a trigger webhook event in Botpress, you need to add the Webhook URL in the Botpress Webhook URL section. This is optional

image.pngimage.png

Now copy the code in the Integration panel and add it to your Botpress hook

 

image.png

Important: you need to pass the WhatsApp Phone Number of the user conversing as a parameter, which without vCX platform will not be able to show the user details on the conversations tab.
In the above screenshot "user.phonenumber" is a variable that has the phone number of the user

ThisNow the setup is complete, to test the HITL feature you can easily toggle between Human and Bot in the conversation section

 image.png