Whatsapp/twilio not connecting to rasa

Hi

I am using rasa 3.0.6 on Ubuntu (Azure) and trying to connect to Whatsapp. I have followed the instructions in the docs and blog

When I use curl I get a response:

curl -POST http://xxxx.cloudapp.azure.com:5005/webhooks/rest/webhook/ -d '{"message":"my name is rafa"}' -v

HTTP/1.1 200 OK
 Access-Control-Allow-Origin: *
 Access-Control-Expose-Headers: filename
 Access-Control-Allow-Credentials: true
 content-length: 59
 connection: keep-alive
 content-type: application/json
* Connection #0 to host xxxx.cloudapp.azure.com left intact
[{"recipient_id":"default","text":"Nice to meet you rafa"}]

‘’’

But when I do it in Whatsapp I get no response, and Twilio console I get a 11200 error (HTTP retrieval failure). Nothing pops in the rasa logs, so it must not be getting a request.

The configuration of the sandbox has exactly the same URI in “WHEN A MESSAGE COMES IN” that I use for curl from my computer (so not an Azure networking problem)

Any ideas?

Hello @rafa21 I hope this video tutorial will help you: SETUP RASA CHATBOT ON WHATSAPP - YouTube

Hi @nik202 I had also tried following that video, and did again just now, but same outcome. Whatsapp connects to Twilio - I was able to send a receive messages during the sandbox setup process. I can access the rasa API from outside the server (tried with curl), but why is Twilio not connecting to rasa? I am not sure how to debug it. Would you be available for a quick call?

thanks R

@rafa21 have you seen this : Twilio

Hi @nik202

Yes, that was one of the first documents I used.

@rafa21 are you able to chat with the bot using whatsapp?

Hi @nik202

No, I can’t. The bot works well with the Chat widget, using the same API.

I can also access the API using CURL.

I can send and receive messages to the Twilio sandbox, but Twilio does not seem to connect to Rasa. The URI is the same I use in curl, so I don’t understand what can be wrong. I think rasa is supposed to reply using TwiML, but I have not activated anything for that.

I am using

hostname:5005/webhooks/rest/webhook

but the documentation talks about /webhooks/twilio/webhook

yet when you start rasa on debug mode, there is no port for Twilio

vailable web server routes: 
/conversations/<conversation_id:path>/messages     POST                           add_message
/conversations/<conversation_id:path>/tracker/events POST                           append_events
/webhooks/rasa                                     GET                            custom_webhook_RasaChatInput.health
/webhooks/rasa/webhook                             POST                           custom_webhook_RasaChatInput.receive
/webhooks/rest                                     GET                            custom_webhook_RestInput.health
/webhooks/rest/webhook                             POST                           custom_webhook_RestInput.receive
/model/test/intents                                POST                           evaluate_intents
/model/test/stories                                POST                           evaluate_stories
/conversations/<conversation_id:path>/execute      POST                           execute_action
/domain                                            GET                            get_domain
/socket.io                                         GET                            handle_request
/                                                  GET                            hello
/model                                             PUT                            load_model
/model/parse                                       POST                           parse
/conversations/<conversation_id:path>/predict      POST                           predict
/conversations/<conversation_id:path>/tracker/events PUT                            replace_events

I assume /webhooks/rest/webhook would work?

@rafa21 alright strange. Did you mentioned the twilio credentials in credentials.yml ?

twilio:
  account_sid: " "
  auth_token: " "
  twilio_number: " "

If yes perfect :+1:

Then, run the ngrok http 5005 on terminal and copy the https link and paste it in WHEN A MESSAGE COMES IN

https://ngrok-url/webhooks/twilio/webhook

If already done perfect.

I guess you missing some major step :frowning:

I started things from scratch and it was an embarrassing simple error: The Twilio section of credentials had a bad tab and was not being read properly - and not reporting any bug either. Thanks for your help anyway