Article

Sending Rich Link Messages

Enhance the customer's experience by allowing them to preview inline content.

Overview

When a business sends a URL with an inline image or video to a customer, the customer receives a "Tap to Load Preview" message, which the customer then needs to tap to load the content. To allow customers to preview content inline without first loading a preview, you can send a rich link message instead.

Add an Image Using Rich Links

When coding a richLinkData message to send an image, you need to include the business URL, title of the image, and details about the image, including its data and MIME types, as shown in Listing 1.

Listing 1

Sample of a rich link containing an image

{
    "body": "https://www.apple.com/ipad-pro/",
    "sourceId": "<business_id>",
    "destinationId": "<destination_id>",
    "v": 1,
    "type": "richLink",
    "id": "<message_id">,
    "richLinkData": {
        "url": "https://www.apple.com/ipad-pro/",
        "title": "iPad Pro",
        "assets": {
            "image": {
              "data": "/9j/4AAQSkZJRgABAQA…………<snipped>…………AAQAB/Z",
              "mimeType": "image/jpeg"
            }
        }
    }
}

Figure 1 shows an image rich link bubble on iPhone.

Figure 1

A rich link message, displaying an image to the customer

A rich link message, displaying an image to the customer on iPhone.

Add a Video and Image Using Rich Links

When sending video as a rich link, include a complementary background image or something from the video. Video and image rich links require the same assets⏤URL, title, data, and MIME types⏤to create the message bubble. Video rich links also include a URL to the video, as shown in Listing 2.

Listing 2

Sample of a rich link, containing a video

{
    "body": "https://images.apple.com/media/us/homepod/2018/98e6cc1a_37ec_4e69_b717_9e58c71e1937/films/expand/homepod-expand-tpl-cc-us-20180306_1280x720h.mp4",
    "sourceId": "<business_id>",
    "destinationId": "<destination_id>",
    "v": 1,
    "type": "richLink",
    "id": "<message_id">,
    "richLinkData": {
        "url": "https://images.apple.com/media/us/homepod/2018/98e6cc1a_37ec_4e69_b717_9e58c71e1937/films/expand/homepod-expand-tpl-cc-us-20180306_1280x720h.mp4",
        "title": "HomePod",
        "assets": {
            "video": {
                "url": "https://images.apple.com/media/us/homepod/2018/98e6cc1a_37ec_4e69_b717_9e58c71e1937/films/expand/homepod-expand-tpl-cc-us-20180306_1280x720h.mp4",
                "mimeType": "video/mp4"
            }
        }
    }
}

Figure 2 shows a video rich link bubble, displayed in Messages on iPhone. The play button is the video link, which sits on top of the background image. The video loads and starts playing when tapped.

Figure 2

A rich link message, displaying a video to the customer

A rich link message, displaying a video to the customer.

Topics

Rich Link Dictionaries

object ImageAsset

Keys in the image asset dictionary.

object RichLinkData

Keys in the richLinkData dictionary.

object RichLinkDataRef

Keys for the richLinkDataRef dictionary.

object RichLinkResponse

Subdictionary keys contained in the JSON response's dataRef key.

object VideoAsset

Keys in the video asset dictionary.

type RichLinkMessage

Rich link message containing an inline image or video.

See Also

Message Types

Sending Text Messages

Send a text message from the business to the customer’s device.

Interactive Messages

Provide a rich user experience with interactive messages, like list picker, time picker, authentication, and Apple Pay.