# Utter Message with Video Twilio

**URL:** <https://forum.rasa.com/t/utter-message-with-video-twilio/36004>\
**Category:** \[Deprecated\] Rasa X Community Edition\
**Created:** [October 18, 2020, 4:14am UTC](https://forum.rasa.com/t/utter-message-with-video-twilio/36004 "2020-10-18T04:14:08Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![basil-chatha](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/basil-chatha/32/9260_2.png) [@basil-chatha](https://forum.rasa.com/u/basil-chatha)\
**Post date:** [October 18, 2020, 4:14am UTC](https://forum.rasa.com/t/utter-message-with-video-twilio/36004/1 "2020-10-18T04:14:08Z")

</div>

I would like to embed a video I retrieve from AWS S3 into my conversations (I’m using Twilio SMS as my channel), but cannot figure out how to do it if it is possible. Here’s what I tried:

```python
dispatcher.utter_message(attachment={
					"type": "video",
					"payload": {
						"title": "My Video",
						"src": video_url
					}
				})

```

But this is what I get in the conversation: ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/3/35cfdf3d3d351bc4acf908558eb317b06c988a7d.png)

Any suggestions?

---

<div class="post-metadata">

**Author:** ![erohmensing](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/erohmensing/32/1789_2.png) [@erohmensing](https://forum.rasa.com/u/erohmensing)\
**Post date:** [October 21, 2020, 3:21pm UTC](https://forum.rasa.com/t/utter-message-with-video-twilio/36004/2 "2020-10-21T15:21:22Z")

</div>

If you check [the code](https://github.com/RasaHQ/rasa/blob/master/rasa/core/channels/twilio.py), twilio doesn’t support attachments, as there is no `send_attachment` method.

However it does support [custom output payloads](https://rasa.com/docs/rasa/responses#custom-output-payloads), which allows you to send anything the api can process. [This](https://github.com/twilio/twilio-python/blob/b3a960a70dc1f59f9427de0c47199d514bd79d5a/twilio/rest/api/v2010/account/message/ __init__.py#L38) is the wrapper method that is called by the `utter_custom_json` method – I think you are looking for `media_url` here. More info about sending media here: [Accepted Content Types for Media - Twilio](https://www.twilio.com/docs/sms/accepted-mime-types)

---

<div class="post-metadata">

**Author:** ![basil-chatha](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/basil-chatha/32/9260_2.png) [@basil-chatha](https://forum.rasa.com/u/basil-chatha)\
**Post date:** [October 21, 2020, 9:46pm UTC](https://forum.rasa.com/t/utter-message-with-video-twilio/36004/3 "2020-10-21T21:46:49Z")

</div>

@erohmensingAfter trying what you suggested, here’s what I’m doing now:

```python
message = {}
message['media_url'] = video['video_url']
dispatcher.utter_custom_json(message)

```

But I’m not getting anything returned in my SMS. Here’s what I see in RasaX:

 ![Screen Shot 2020-10-21 at 2.41.40 PM](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/e/ea3346e479f9c60a1cb249fa5eced8293e1c46b2.png)

I’m using RasaX version `0.28.3` and Rasa version `1.10.0`

---

<div class="post-metadata">

**Author:** ![basil-chatha](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/basil-chatha/32/9260_2.png) [@basil-chatha](https://forum.rasa.com/u/basil-chatha)\
**Post date:** [October 23, 2020, 8:30am UTC](https://forum.rasa.com/t/utter-message-with-video-twilio/36004/4 "2020-10-23T08:30:46Z")

</div>

Nevermind, just an error on Twilio’s side. Thanks!

---

<div class="post-metadata">

**Author:** ![sabirahmed](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/sabirahmed/32/14325_2.png) [@sabirahmed](https://forum.rasa.com/u/sabirahmed)\
**Post date:** [April 9, 2021, 11:30am UTC](https://forum.rasa.com/t/utter-message-with-video-twilio/36004/5 "2021-04-09T11:30:27Z")

</div>

Hey @basil-chatha: I’m getting the same issue as yours, the message does not show up on Twilio/Whatsapp but a similar message as yours in RasaX. How did you go about fixing this?

---

<div class="post-metadata">

**Author:** ![sabirahmed](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/sabirahmed/32/14325_2.png) [@sabirahmed](https://forum.rasa.com/u/sabirahmed)\
**Post date:** [April 9, 2021, 11:47am UTC](https://forum.rasa.com/t/utter-message-with-video-twilio/36004/6 "2021-04-09T11:47:21Z")

</div>

Nevermind, found out the only video format that is acceptable is mp4 with H264 and AAC. Worked once the format was corrected. Thanks anyways 🙂

---

<div class="post-metadata">

**Author:** ![zack](https://avatars.discourse-cdn.com/v4/letter/z/f6c823/32.png) [@zack](https://forum.rasa.com/u/zack)\
**Post date:** [May 3, 2021, 12:35pm UTC](https://forum.rasa.com/t/utter-message-with-video-twilio/36004/7 "2021-05-03T12:35:56Z")

</div>

> [@basil-chatha](#):
>
> `media_url`

Hi @erohmensing ,

Can you give us a custom output payloads where we set `media_url` as a responses to attach video on the domain.yml file.

---

<div class="post-metadata">

**Author:** ![erohmensing](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/erohmensing/32/1789_2.png) [@erohmensing](https://forum.rasa.com/u/erohmensing)\
**Post date:** [May 6, 2021, 10:29am UTC](https://forum.rasa.com/t/utter-message-with-video-twilio/36004/8 "2021-05-06T10:29:24Z")

</div>

You’ll have to check the twilio API for that. For example here is the REST reference for twilio messages: [Message Resource Reference for the Twilio Messaging REST API - Twilio](https://www.twilio.com/docs/sms/api/message-resource#message-properties) where you can attach media

And the REST reference for the media attaachments: [Media Resource - Twilio](https://www.twilio.com/docs/sms/api/media-resource#media-properties)

Unfortunately thats about as much information as I can give you, as we only enable you to send what Twilio supports, and don’t have examples handy for every possibility.
