Multimedia Variable
Learn how to configure multimedia variables in your conversation flows. This will allow you to add images, videos, audio, and attachments and send them dynamically in your conversations.
Attach Multimedia - Multimedia Variable
In the Treble editor, you can attach multimedia to your messages. This will allow you to add images, videos, audio, and file attachments and send them dynamically in your conversations.
Normally, you do it as follows:
- Go to the conversation node where you want to attach the multimedia.
- Select the type of multimedia you want to attach.
- Select the file you want to attach.
- Click on Attach.
Now, let’s see how you can make the multimedia content not a static content, but a dynamic one. For this, follow these steps:
- Go to the conversation node where you want to attach the multimedia.
- Click on the Attach button.
- Choose the Variable option.
- This will open a modal where you can define the name of the variable. In our example, we will call it
media_url
. This variable is auser_session_key
.
- Done! Now, this variable (in our case
media_url
) will wait for the URL of the image, video, audio, or file attachment that you want to attach.
The URL of the image, video, audio, or file attachment must be a public URL. To check if it’s a public URL, you can open it in your browser. If you can see the content, then it’s a public URL.
How is this variable handled?
You have the following options to handle this variable:
Option 1: CSV deployment of your conversation flow
In this case, when you upload a CSV file, the content of the media_url
column should be the URL of the image, video, audio, or file attachment that you want to attach. This will allow you to send a customized file URL for each user.
For example:
country_code | cellphone | name | media_url |
---|---|---|---|
57 | 3132392346 | Felipe | https://example.com/image.jpg |
34 | 622902416 | Camila | https://example.com/video.mp4 |
Outbound conversation flow deployment
Learn how to send an outbound conversation.
Option 2: API deployment
In this case, when you make a call to the Treble API, you must send the content of the media_url
variable in the call body. This variable will be part of the user_session_keys
that are sent in the call.
For example:
Deploy conversation flow by API
Learn how to deploy a conversation flow by API.
Option 3: In a webhook response
In this case, when you make a call to a webhook, and before reaching the conversation node with the node that has the media_url
variable, you can call a webhook, and in the response of this webhook, you can send the URL of the image, video, audio, or file attachment that you want to attach.
Webhook response
You can add the URL of the image, video, audio, or file attachment in a webhook response through the user_session_keys
.
Done! Now you can attach multimedia dynamically in your conversations.