# Message

Add a Message block by [dragging and dropping it](https://docs.chatlayer.ai/buildabot/bot-navigation/bot-builder/flows/canvas-functionalities#drag-and-drop) to your flow.

<figure><img src="https://2786867680-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FPJIl1HTZOSfhyWDDWqEu%2FScreenshot%202024-06-24%20at%2016.11.56.png?alt=media&#x26;token=cf9ded9a-a4b2-4454-b8a8-6932e5ba0067" alt=""><figcaption><p>The Message block.</p></figcaption></figure>

## Character limits

Chatlayer indicates how many characters are still allowed on the bottom-right corner of any text field.

The only exception is for [**Carousels**](#carousel), which show the number of characters that you already enter and not the character limit.&#x20;

<figure><img src="https://2786867680-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2F9nY5EjUU17esyjaJ0AOZ%2FScreenshot%202024-06-24%20at%2016.13.54.png?alt=media&#x26;token=a5ddd1f6-e4f7-4649-b7b1-0e0290a16255" alt="" width="327"><figcaption><p>Write Message block by respecting the character limits indicaetd.</p></figcaption></figure>

{% hint style="warning" %}
Please note that for Facebook Messenger, limits are strict to 20 characters for a [button](#buttons) label. If your button label is bigger, it will be cut off and displayed with three dots. Learn more about our [channels limitations](https://developers.sinch.com/docs/conversation/message-types/).
{% endhint %}

{% hint style="info" %}
For all other channels, the character limit is based on best practices. We recommend using less characters than the limit, but it's not mandatory.
{% endhint %}

## Message steps <a href="#text" id="text"></a>

### Text message

Text messages are the most simple components. Most channels will show them as speech bubbles.

<figure><img src="https://2786867680-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2F9nY5EjUU17esyjaJ0AOZ%2FScreenshot%202024-06-24%20at%2016.13.54.png?alt=media&#x26;token=a5ddd1f6-e4f7-4649-b7b1-0e0290a16255" alt="" width="327"><figcaption><p>Text message step.</p></figcaption></figure>

### Buttons

Buttons are a useful way to guide the conversation by giving the user a limited set of options. You can add a maximum of three buttons to a message, with different [button types](#button-types).

<figure><img src="https://2786867680-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FEBvbVILwLnIPJgzJyH4B%2FScreenshot%202024-06-24%20at%2016.25.26.png?alt=media&#x26;token=c9778e36-35d1-4930-ad26-79e18bcde291" alt="" width="328"><figcaption><p>Buttons step.</p></figcaption></figure>

<details>

<summary>Button types</summary>

There are 4 different types of buttons:

* **Go to**: When this button is clicked, the conversation goes to a new block. Optionally, you can add key-value combinations to a button. These will set variables depending on which button the user has clicked. These variables can then later be used to route blocks, do an API call or render specific text.
* **URL**: you can link a button to an external URL.
* **Call**: this button will initiate a call if the user is using a mobile device.
* **Webview**: this button will open a webview (or a new browser window depending on the channel) with the configured URL as target. The parameters you configure for this button will be JSON stringified and appended to the URL as a Base64 encoded string. It is possible to decode this string using the `atob`  JavaScript function.

<img src="https://2786867680-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FkrEjFvekEsCYqpLmbHA9%2FScreenshot%202024-02-06%20at%2013.03.11.png?alt=media&#x26;token=6927b8a4-d82b-42cd-aa81-50260fe3ee72" alt="Button types on Chatlayer" data-size="original">

</details>

### Media

With the **Media** step, you can enable the bot to send files to your users.

<figure><img src="https://2786867680-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2F1aBSaS7YCTuNGt2jflRo%2FScreenshot%202024-12-03%20at%2015.02.29.png?alt=media&#x26;token=2e511e9d-2528-4553-83b0-ea3880aa9ade" alt="" width="375"><figcaption><p>Media step.</p></figcaption></figure>

<details>

<summary>Media types</summary>

* **Images**: all typical image types, such as jpg, png and gif are supported on our platform.
* **Video**: videos are available in the [Emulator](https://docs.chatlayer.ai/buildabot/emulator), [W](https://docs.chatlayer.ai/channels/all-channels/web/web-v2)[eb ](https://docs.chatlayer.ai/channels/all-channels/web/web-v2)and Facebook channel. Check [this article](https://docs.chatlayer.ai/support/solving-bot-issues/3.-media-upload-not-working) to add videos to your bot. The following video formats are supported:
  * mp4
  * ogv
  * webm
* **Audio**: the audio media is available in the [Emulator](https://docs.chatlayer.ai/buildabot/emulator), the [Web](https://docs.chatlayer.ai/channels/all-channels/web/web-v2) channel and [Facebook Messenger](https://docs.chatlayer.ai/channels/all-channels/facebook). Currently we only support MP3 as an audio format.
* **Files**: file attachments are available in [Facebook Messenger](https://docs.chatlayer.ai/channels/all-channels/facebook). Currently, only PDF is supported.  If you upload the file directly in the platform, there is a file size limit of 10 MB. If you use a direct URL to the file, there is no file size limit.

</details>

{% hint style="warning" %}
Are you having trouble adding an external video to your bot? Check out [this ](https://docs.chatlayer.ai/tips-and-best-practices/solving-bot-issues/3.-media-upload-not-working)article.
{% endhint %}

{% hint style="warning" %}
Ensure that you remove space from media files that are uploaded, this could cause it not to be displayed correctly.
{% endhint %}

{% hint style="info" %}
We recommend media files shared on Facebook Messenger to be below 5 MB in size, as Facebook seems to have trouble in handling files larges with acceptable performance.
{% endhint %}

### Quick replies

Quick replies behave similarly to buttons. They are shown horizontally next to each other in a scrollable container. This means that you can add as many quick replies as you think necessary.

<figure><img src="https://2786867680-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FhzftTG0WBHnKTB1Fk9Bo%2FScreenshot%202024-06-24%20at%2016.26.41.png?alt=media&#x26;token=a3cb5ec0-5e38-484d-bff7-a6c6fe340642" alt="" width="330"><figcaption></figcaption></figure>

<details>

<summary>Quick replies settings</summary>

* **Icon**: optionally, you can add an icon to a quick reply by specifying its URL.
* **Go to**: for each Quick reply, you need to define a next block to visit in the flow. In other words, you'll create a [Go-to connection](https://docs.chatlayer.ai/buildabot/flow-logic/go-to-connections).
* **Variables**: optionally, [variables](https://docs.chatlayer.ai/navigation/settings/secure-variables-gdpr) can be set depending on which button the user has clicked. These variables can then later be used to route blocks, make an API call or render specific text.

</details>

{% hint style="info" %}
Note that **Quick replies** only link to another block. To link your button to anything else, use [**Buttons**](#buttons).
{% endhint %}

### Carousel

Carousels are a way to visualize options, with or without images and buttons.&#x20;

Buttons in Carousels are the same as regular [**Buttons**](#buttons) and use the same properties like payloads and URL, with the addition of an extra share button.

<figure><img src="https://2786867680-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2F9Y010uSk2RzV9jNLMjqM%2FScreenshot%202024-06-24%20at%2016.32.24.png?alt=media&#x26;token=53b33c17-f296-4cc3-ab63-27809538b80c" alt="" width="375"><figcaption><p>Carousel step.</p></figcaption></figure>

{% hint style="success" %}
You're using Carousels for your RCS channel? See how you can [make the most of them](https://docs.chatlayer.ai/channels/sinch-conversation-api-beta/make-the-most-of-rcs-with-carousels).
{% endhint %}

<details>

<summary>Share button</summary>

The share button opens a sharing block in Facebook Messenger, enabling people to share message bubbles (aka carousel cards) with their friends.

When a new user receives a message bubble, he can share it with his friends by tapping the same share button. When tapping the postback button, the user is send to the start page of the bot.

You can only use share button in generic templates items (previously called carousels) and only items with maximum one url can be shared by Facebook. It is not possible to change the button title: Facebook Messenger will translate the button to the user's preferred language profile setting.

<img src="https://2786867680-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LLTwFwbOqJj4dDhg8Ju%2F-LLTwINdA-k01sAajhSX%2F-LLTwJKVzShk3Y7meASp%2Fcarousel.png?generation=1535969958196585&#x26;alt=media" alt="" data-size="original">

</details>

### List

The List step is a step that allows you to present a list of items, shown vertically.

Each item may shown a button that can be used as a call-to-action (postback). You can also provide a URL that opens when an item is tapped.

Each list template message can also have up to one global button that will show below the item list.

<details>

<summary>List styles</summary>

Lists can be shown in 2 different syles:

* **Large** lists show the first item with a cover image and text overlay. This is useful if you want to make the first item stand out over the other items.

<img src="https://2786867680-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LLTwFwbOqJj4dDhg8Ju%2F-LLTwINdA-k01sAajhSX%2F-LLTwJKXmBQxe0crxOg7%2Flist%20template.png?generation=1535969958272193&#x26;alt=media" alt="" data-size="original">

* **Compact** lists show each item in the same way. This is useful for presenting a list of items where no item is shown more prominently.

<img src="https://2786867680-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LLTwFwbOqJj4dDhg8Ju%2F-LLTwINdA-k01sAajhSX%2F-LLTwJKZWVwNUi1O0xTs%2Flist%20template%20compact.png?generation=1535969952924562&#x26;alt=media" alt="" data-size="original">

</details>

### File upload

Use the file upload template to let users upload a file directly from their device to your bot.

{% hint style="info" %}
This template only works on the web widget V1 channel. For any other channel, you can use the 'image' format type in the [Collect input](https://docs.chatlayer.ai/buildabot/flow-logic/dialog-state/user-input-bot-dialog) block.
{% endhint %}

<figure><img src="https://2786867680-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FXHbVGUXeKFwmtLOg8hUT%2FScreenshot%202024-06-24%20at%2016.34.56.png?alt=media&#x26;token=e1015596-132a-40ca-aff5-c6b53321e9e1" alt="" width="333"><figcaption><p>File upload Message step.</p></figcaption></figure>

Configuring the File Upload as shown above will show an Upload button in the conversation:

![](https://2786867680-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LLTwFwbOqJj4dDhg8Ju%2F-M3L63O1_lCPCmfdqyUK%2F-M3LukpL2-eh7WBMg5h1%2Fimage.png?alt=media\&token=d32aee90-41b1-44f6-863a-a8db92300237)

<details>

<summary>Notes on File upload</summary>

* If the upload failed because there was a problem with the connection, or the file the user chose was bigger than 10 MB, the bot will go to the "failed upload" block.
* The URL where the uploaded file is stored can be found under the `{uploadedFileUrl}` variable in the [user's session](https://docs.chatlayer.ai/quickstart/tutorials/leadzy-tutorial/3.-collect-and-display-user-input#check-the-variable-in-the-user-session). You can reuse this variable to show the file that the user uploaded by using the [Media](#attachments) step. Alternatively, you can retrieve the URL with an [API plugin](https://docs.chatlayer.ai/integrateandcode/custom-back-end-integrations) to store the files on your servers.
* Uploaded files are kept on Chatlayer servers for 30 days, after which they will automatically become unaccessible.

</details>

### Rich text

Rich text allows you to go beyond text messages and style your text the way you want it. You can also add web links using the rich text editor.

{% hint style="warning" %}
Rich text is only visible in the [Web](https://docs.chatlayer.ai/channels/all-channels/web/web-v2) channel. The other channels do not support this type of text.
{% endhint %}

<figure><img src="https://2786867680-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FfnD45ZhUsVSHeVYs8Y5K%2FScreenshot%202024-06-24%20at%2016.37.39.png?alt=media&#x26;token=d0a8fd5d-2dbf-4e26-a9bc-3084b1ec1c36" alt="" width="326"><figcaption><p>Rich text Message step.</p></figcaption></figure>

<details>

<summary>Rich text styles</summary>

The rich text editor allows you to use the following styles:

* Paragraph
* Heading 1
* Heading 2
* Heading 3
* Heading 4
* Bulleted list
* Ordered list (= numbered list)

And format the text in the following ways:

* **Bold**
* *Italic*
* Underline

You can also add hyperlinks (weblinks) that either go to an external page or to a specific place in your conversation.

To hyperlink a word or sentence, select it and then click the chain icon on the right below. A popup will appear where you can put in the link address. Then click 'save'.

</details>
