# Integration with Twilio

**URL:** <https://forum.rasa.com/t/integration-with-twilio/2926>\
**Category:** Rasa Open Source\
**Created:** [November 24, 2018, 11:27pm UTC](https://forum.rasa.com/t/integration-with-twilio/2926 "2018-11-24T23:27:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sanjoydey](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@sanjoydey](https://forum.rasa.com/u/sanjoydey)\
**Post date:** [November 24, 2018, 11:27pm UTC](https://forum.rasa.com/t/integration-with-twilio/2926/1 "2018-11-24T23:27:59Z")

</div>

I am facing a problem in integrating my app with twilio. My environment is 3 docker containers for rasa-NLU, Rasa-CORE and rasa-core-sdk and a 4th one for ngrok. They are all on the same network.

When I type in a text in the phone I get in my ngrok server:

POST /webhooks/twilio/webhook 200 OK

and my rasa\_core

172.29.0.5 - - [2018-11-24 22:36:00] “POST /webhooks/twilio/webhook HTTP/1.1” 200 124 0.046605

But my custom action in rasa\_core\_sdk is not activated.

When I post from the command line then everything works as expected

rasa\_nlu\_1 | 2018-11-24 22:53:19+0000 [-] “172.29.0.2” - - [24/Nov/2018:22:53:18 +0000] “GET /parse?model=&project=current&q=in+Moscow HTTP/1.1” 200 609 “-” “python-requests/2.20.0”

action\_server\_1 | DEBUG:rasa\_core\_sdk.executor:Received request to run ‘action\_weather’

action\_server\_1 | DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): [api.apixu.com:80](http://api.apixu.com:80)

action\_server\_1 | DEBUG:urllib3.connectionpool:[http://api.apixu.com:80](http://api.apixu.com:80) “GET /v1/current.json?key=xxxxxx&q=moscow HTTP/1.1” 200 395

action\_server\_1 | DEBUG:rasa\_core\_sdk.executor:Successfully ran ‘action\_weather’

In Twilio debugger I see a warning Warning - 12200. The other details in Twilio are: Message TextShow Raw

| Msg | “Content is not allowed in prolog.” |
| --- | --- |
| line | “1” |
| sourceComponent | “14100” |
| parserMessage | “Content is not allowed in prolog.” |
| ErrorCode | “12200” |
| EmailNotification | “false” |
| cols | “1” |
| LogLevel | “WARN” |

Response

Headers

**X-Cache** MISS from Twilio-Cache **X-Cache-Lookup** MISS from Twilio-Cache:3128 **Content-Length** 9 **Date** Sat, 24 Nov 2018 22:36:00 GMT **Content-Type** text/html; charset=utf-8

BodyShow Raw

In London

What could be the problem? Thanks

---

<div class="post-metadata">

**Author:** ![tmbo](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/tmbo/32/19_2.png) [@tmbo](https://forum.rasa.com/u/tmbo)\
**Post date:** [November 27, 2018, 10:04am UTC](https://forum.rasa.com/t/integration-with-twilio/2926/2 "2018-11-27T10:04:20Z")

</div>

What happens if you send a CURL request with a twilio like payload to the `/webhooks/twilio/webhook` endpoint of the rasa core container?

---

<div class="post-metadata">

**Author:** ![sanjoydey](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@sanjoydey](https://forum.rasa.com/u/sanjoydey)\
**Post date:** [November 28, 2018, 12:49am UTC](https://forum.rasa.com/t/integration-with-twilio/2926/3 "2018-11-28T00:49:51Z")

</div>

I made is CURL request and this was the response

curl --request POST --url [http://localhost:5005/webhooks/twilio/webhook](http://localhost:5005/webhooks/twilio/webhook) --header ‘content-type: application/json’ --data ‘{“message”: “hello”}’

404 Not Found
# Not Found

The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

Strangely the “Hello” message gets me the right response when I send a text from the phone.

I have not made a CURL request for action-server response e.g. “What is the weather in London?”, since the basic CURL is itself not working.

Maybe I am making a simple mistake in the CURL request.

Another point, when I see the debugger in Twilio, it seems the header Content-Type is text/html; charset=utf-8 and not application/json

---

<div class="post-metadata">

**Author:** ![argideritzalpea](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/argideritzalpea/32/7528_2.png) [@argideritzalpea](https://forum.rasa.com/u/argideritzalpea)\
**Post date:** [February 2, 2019, 1:23am UTC](https://forum.rasa.com/t/integration-with-twilio/2926/4 "2019-02-02T01:23:11Z")

</div>

Was this ever resolved? If so, do you have any code on GitHub regarding Rasa / Twilio integration? I’m trying to learn how to integrate them and am not finding much in the way of documentation from the recent blog post from Rasa on the issue.

---

<div class="post-metadata">

**Author:** ![praveen123](https://avatars.discourse-cdn.com/v4/letter/p/f07891/32.png) [@praveen123](https://forum.rasa.com/u/praveen123)\
**Post date:** [December 16, 2019, 6:15am UTC](https://forum.rasa.com/t/integration-with-twilio/2926/5 "2019-12-16T06:15:28Z")

</div>

even I am facing the same issue now.

When I type in a text in the WhatsApp I get in my ngrok server and my and my rasa\_core too,

but I am not getting the response back to WhatsApp.

What could be the problem?

Thanks in advance
