Here you can learn how to setup Twilio in order to use Whatsapp as a messaging platform for the Chatbot generator.
Twilio Sandbox for WhatsApp allows you to prototype with WhatsApp immediately, without waiting for your Twilio number to be approved for WhatsApp.
First, create a new account at Twilio.
You'll be asked to verify your email:
Then, you'll be asked to verify your phone number:
You'll have to go through some steps:
Here you can skip to dashboard:
Then go through "All Product & Services" and select "Programmable Messaging". In a new window that appears, you have to select "WhatsApp" and it asks you if you want to activate the Sandbox.
To activate the sandbox, a page like this one appears:
Select a number from the available sandbox numbers:
There's a learn tutorial that you can follow easily.
The sandbox is pre-provisioned with a Twilio phone number.
Send “join <your sandbox keyword>” to your Sandbox number in WhatsApp to join your Sandbox.
After joining, you will receive a message from the sandbox:
See here for more details.
When customers send you a WhatsApp message, Twilio sends a webhook to your application.
On the sandbox page you have to configure the URL that Twilio sends a webhook to for inbound messages.
The Chatbot generator creates a webhook (see HowTo: Integrate Chatbots using WhatsApp), under the instance's module.
After building it, configure the URL as follows:
http://<server>/<baseURL>/<InstanceModule>.WhatsappWebhook.aspx (.NET) or http://<server>/<baseURL>/<InstanceModule>.WhatsappWebhook (Java)
This has to be configured by going through Programmable Messaging > Settings > Whatsapp sandbox settings. Note that the computer where the webhook is hosted, has to be visible from Internet:
In the console page, you have the Account SID and an Authorization Token. These credentials are needed to the interaction with Twilio
Account SID - Used to identify yourself in API requests
Auth Token - Used to authenticate REST API requests
The Auth Token is the information needed when you send messages through Twilio. This is the information to be configured in the
WebHook.
Note:
If you joined your Sandbox > 24 hours ago, you will need to send a fresh inbound message to your WhatsApp number in order to then send yourself a media message. Otherwise, you'll get the "ERROR - 63016
Failed to send freeform message because you are outside the allowed window. Please use a Template."