Image List Picker
  • 05 Jun 2024
  • 2 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Image List Picker

  • Dark
    Light
  • PDF

Article summary

Overview

With Image List Picker, you can create a list of elements with text and images.

Image List Picker

For more information on Image List Picker, go to the official documentation of Apple Messages for Business: List Picker Message.

Example

Below, you can see the imageListPicker task reference in the Attachments State Diagram.

{
    "abc": {
        "type": "image_list_picker",
        "images": [
            {
                "identifier": "0",
                "url": "https://i5.walmartimages.com/asr/2b4a8c7c-941f-4575-b1fe-2479c8024077_1.b3c876a51211d14cbdd5fc631995809c.jpeg"
            },
            {
                "identifier": "1",
                "url": "https://i5.walmartimages.com/asr/d43233f6-920f-4b9d-9b97-80a31487901b_1.9ecb6491c6307ebd24e5426dfc9ee4e8.jpeg"

            }
        ],
        "list_picker": {
            "sections": [
                {
                    "items": [
                        {
                            "identifier": "1",
                            "imageIdentifier": "0",
                            "order": 0,
                            "title": "Gala Apples",
                            "subtitle": "Price: $1.57 / each",
                            "style": "default"
                        },
                        {
                            "identifier": "2",
                            "imageIdentifier": "1",
                            "order": 1,
                            "title": "Navel Oranges",
                            "subtitle": "Price: $0.68 / each",
                            "style": "default"
                        }
                    ],
                    "order": 0,
                    "title": "Fruit",
                    "multipleSelection": true
                }
            ],
            "receivedMessage": {
                "style": "small",
                "subtitle": "Farm fresh to you",
                "title": "✅ Select Produce"
            },
            "replyMessage": {
                "style": "small",
                "title": "✅ Selected Produce",
                "subtitle": "Selected Produce"
            }
        }
    }
}

Parameters

ParameterTypeRequiredDescription
typestring+A type of an object to send.
imagesarrayAn array of objects with images.
images[].urlstringA link to an image.
images[].identifierstring+An image ID used for substitution in the array items.
list_pickerobject+An object in which all Text List Picker parameters are described.
list_picker.sectionsarray+An array of sections.
list_picker.sections[].itemsarrayAn array of items.
list_picker.sections[]items[].titlestring+An item’s title.
list_picker.sections[]items[].subtitlestringAn item’s subtitle.
list_picker.sections[]items[].imageIdentifierstringAn image ID value from the array “images”.
list_picker.sections[]items[].identifierstring+An item ID sent to Corezoid when it has been selected by the client
list_picker.sections[]items[].stylestringDefines an item style. The default is "icon". Available values: "icon", "small", or "large".
list_picker.sections[]items[].orderintegerA sequence number of an item in a list - items.
list_picker.sections[].orderintegerA sequence number of a section.
list_picker.sections[].titlestring+A section title.
list_picker.sections[].multipleSelectionbooleanDetermines whether simultaneous multiple choice of items is available. Default: false.
list_picker.receivedMessageobject+An object that describes a received message of a list items selected by the user.
list_picker.receivedMessage.titlestring+A title displayed when a client receives a message.
list_picker.receivedMessage.subtitlestring+A subtitle displayed when a client receives a message
list_picker.receivedMessage.stylestring+Defines an item style. The default is "icon". Available values: "icon", "small", or "large".
list_picker.replyMessageobject+An object which contains a description of how to display a message after a reply.
list_picker.replyMessage.titlestring+A title displayed when the message has been sent by the user.
list_picker.replyMessage.subtitlestring+A subtitle that is displayed when the message has been sent by the user.
list_picker.replyMessage.stylestring+Defines an item style. The default is "icon". Available values: "icon", "small", or "large".

Adding item

Image List Picker_Add

To add an item to Image List Picker, the following object needs to be added to the items[] and images[] arrays:

"images": [
             {
                "identifier": "1",
                "url": "{{image URL}}"
            }
        ]
"items": [
        {
            "identifier": "1", 
            "imageIdentifier": "1", 
            "order": 0, 
            "title": "Gala Apples",
            "subtitle": "Price: $1.57 / each", 
            "style": "small" 
        } 
]

Was this article helpful?

What's Next