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:

FieldRequiredRemarks
textYesMessage text. Up to 1000 characters. Recommended length is 200 characters.
itemsYesFrom 2 to 5 items.
items titleYesItem title text. From 2 to 38 characters.
mediaUriYesThe URL of the image to display. One per item.
suggestionsYesMaximum 2 suggestions per item. One of them optional.

The following actions are supported by Viber as rich card buttons:

ActionRemarks
OpenURLMaximum length of label is 30 characters, URL required.
DialMaximum length of label is 30 characters, phone number required.

The following restrictions apply for suggestions:

FieldRequiredRemarks
labelYesMaximum length is 10 characters. Optional suggestion maximum 12 characters.
urlOnly for OpenURLMust 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"
                                            }
                                        ]
                                    }
                                ]
                            }
                        }
                    ]
                }
            }
        ]
    }
}