Object

ImageItem

The keys to the image item dictionary used in sending interactive messages.

Properties

data
byte
(Required)

A Base64-encoded string representing the image file data. Always provide @3x images at 72 dpi. The system downscales the @3x images to generate @2x and @1x versions for use on lower-resolution devices.

description
string

Description of the image that the systems reads aloud to customers who have VoiceOver enabled on their device. If the value is null, VoiceOver ignores the image. This key is optional.

identifier
integer

A string containing the image identifier, which must be unique within the list of images. The list picker items and other dictionaries, such as receiveMessage and replyMessage, refer to identifier as imageIdentifier.

Discussion

To send images in an interactive message, add the images array to the interactive message data dictionary. Each element in the array is a key from the image item dictionary.

An example of where you may want to include images is when sending a list picker containing products, and you want to display an image for each product in the array.

Listing 1

A sample array containing two images

"images": [
  {
    "data": "base64encoded-image-file",
    "description": "Optional image description",
    "identifier": "1"
  },
  {
    "data": "base64encoded-image-file",
    "description": "Optional image description",
    "identifier": "2"
  }
]

See Also

Interactive Message Dictionaries

object BaseInteractiveMessage

The Interactive Data dictionary keys common to all interactive messages.

object InteractiveResponse

The response body is a JSON dictionary of the decoded interactive message data dictionary. The dictionary keys are listed below.

object InteractiveMessageData

The keys for the InteractiveMessageData dictionary can be used for all interactive messages.

object InteractiveMessageResponse

A list of dictionaries contained in the feature's response.

object ReceivedMessage

The keys for the received message dictionary.

object ReplyMessage

A dictionary with information telling Messages how and what to display in the reply message bubble.