Carousel messages
Overview
Carousel messages display 2 to 5 horizontal cards that users can swipe through, creating an interactive browsing experience. Each card requires a mandatory image (PNG, JPEG, or JPG format) and can include optional text and up to 2 buttons (at least 1 required, second is optional). Users swipe horizontally to browse through the cards, and each card can have different content, images, and button actions. Carousel messages are categorized as promotional and only available for promotional accounts.
Rules and restrictions
The following restrictions apply for using a rich card:
| Field | Required | Remarks |
|---|---|---|
| text | Yes | Message text. Up to 1000 characters. Recommended length is 200 characters. |
| items | Yes | From 2 to 5 items. |
| items title | Yes | Item title text. From 2 to 38 characters. |
| mediaUri | Yes | The URL of the image to display. One per item. |
| suggestions | Yes | Maximum 2 suggestions per item. One of them optional. |
The following actions are supported by Viber as rich card buttons:
| Action | Remarks |
|---|---|
| OpenURL | Maximum length of label is 30 characters, URL required. |
| Dial | Maximum length of label is 30 characters, phone number required. |
The following restrictions apply for suggestions:
| Field | Required | Remarks |
|---|---|---|
| label | Yes | Maximum length is 10 characters. Optional suggestion maximum 12 characters. |
| url | Only for OpenURL | Must be a valid URL |
Carousel message example
In the example below, we send a message that contains a carousel with two items. Each item is composed of a header, a media image and two suggestions.
{
"messages": {
"msg": [
{
"from": "Your sender",
"to": [
{
"number": "Phone number"
}
],
"body": {
"type": "auto",
"content": "SMS fallback Text"
},
"allowedChannels": [
"Viber, SMS"
],
"richContent": {
"conversation": [
{
"carousel": {
"cards": [
{
"text": "Visit our website or start a chat!",
"media": {
"mediaUri": "your-image.png",
"mimeType": "image/png",
"mediaName": "your-image.png"
},
"suggestions": [
{
"action": "OpenUrl",
"label": "CM.com",
"url": "https://cm.com"
}
]
},
{
"text": "Channels we support!",
"media": {
"mediaUri": "your-image.png",
"mimeType": "image/png",
"mediaName": "your-image.png"
},
"suggestions": [
{
"action": "OpenUrl",
"label": "Viber",
"url": "https://www.cm.com/viber/"
},
{
"action": "OpenUrl",
"label": "Viber",
"url": "https://www.cm.com/viber"
}
]
}
]
}
}
]
}
}
]
}
}
Updated 2 days ago