Apple Business Chat Functions
  • Updated on 23 Jul 2020
  • 12 minutes to read
  • Contributors
  • Print
  • Share
  • Dark
    Light

Apple Business Chat Functions

  • Print
  • Share
  • Dark
    Light

Apple Business Chat Features

In this part you will learn how to work with all Apple Business Chat Functions:

  1. Text List Picker
  2. Image List Picker
  3. Time Picker
  4. Rich Link
  5. Apple Pay
  6. OAuth Request
  7. App Extension Call

Text List Picker

Allows to create a text list of items.
Can be used as a menu, list of products / services, etc.

The official documentation of Apple Business Chat: List Picker

Text List Picker

A Text List Picker Example

The task Reference in a State Diagram Attachments: textListPicker.

   {
       "abc": {    
           "type": "text_list_picker",
               "list_picker": {
                 "sections": [
                   {
                       "items": [
                             {
                               "identifier": "/textListPicker",
                               "order": 0,
                               "title": "📜 Text List Picker",
                               "subtitle": "",
                               "style": "small"
                           } 
                       ],
                       "order": 0,
                       "title": "⚙️ {{t'mainMenu}}",
                       "multipleSelection": false  
                   }
               ],
               "receivedMessage": {
                   "title": "⚙️ {{t'mainMenu}}",
                   "subtitle": "",
                   "style": "small"
               },
               "replyMessage": {
                   "title": "Ok",
                   "subtitle": "",
                   "style": "small"
               }
           }
       }
   }

Text List Picker parameters description

Parameter Type Required Description
type string + A type of an object to send
list_picker object + An object in where all Text List Picker parameters are described
list_picker.sections array + An array of sections - sections
list_picker.sections[].items array + An array of items
list_picker.sections[].items[].title string + An element title - item
list_picker.sections[].items[].subtitle string An element subtitle - item
list_picker.sections[].items[].identifier string + An item ID that is sent to Corezoid when it has been selected by the client
list_picker.sections[].items[].style string Defines an item style. The default is "icon". Available values: "icon" / "small" / "large"
list_picker.sections[].items[].order integer A sequence number of an item in the "items" list
list_picker.sections[].order integer A sequence number of a section
list_picker.sections[].title string + A section title
list_picker.receivedMessage object + An object that describes a received message of a list items selection by the user
list_picker.receivedMessage.title string + A title that is displayed when a customer receives a message
list_picker.receivedMessage.subtitle string + A subtitle that is displayed when a customer receives a message
list_picker.receivedMessage.style string + Defines an item style. The default is "icon". Available values: "icon" / "small" / "large"
list_picker.replyMessage object + An object in where is described how to displays a message after a response
list_picker.replyMessage.title string + A title that is displayed when the message has been sent by the user
list_picker.replyMessage.subtitle string + A subtitle that is displayed when the message has been sent by the user
list_picker.replyMessage.style string + Defines an item style. The default is "icon". Available values: "icon" / "small" / "large"

Adding an item to a Text List Picker

Text List Picker Element

To expand Text List Picker with a new item there’s need to be added the following object to the array items[]:

{
    "identifier": "2",
    "order": 2,
    "title": "Option 2" ,
    "subtitle": "Subtitle for option 2" ,
    "style": "small"
} 

Image List Picker

Allows to create a list of elements with text and images.
The official documentation of Apple Business Chat: List Picker

Image List Picker

An Image List Picker Example

The task Reference in a State Diagram Attachments: imageListPicker.

{
    "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"
            }
        }
    }
}

Image List Picker parameters description

Parameter Type Required Description
type string + A type of an object to send
images array An array of objects with images
images[].url string A link to an image
images[].identifier string + An image ID used for substitution in the array items
list_picker object + An object in where all Text List Picker parameters are described
list_picker.sections array + An array of sections
list_picker.sections[].items array An array of items
list_picker.sections[]items[].title string + An item’s title
list_picker.sections[]items[].subtitle string An item’s subtitle
list_picker.sections[]items[].imageIdentifier string An image ID value from the array “images”
list_picker.sections[]items[].identifier string + An item ID that is sent to Corezoid when it has been selected by the client
list_picker.sections[]items[].style string Defines an item style. The default is "icon".Available values: "icon" / "small" / "large"
list_picker.sections[]items[].order integer A sequence number of an item in a list - items
list_picker.sections[].order integer A sequence number of a section
list_picker.sections[].title string + A section title
list_picker.sections[].multipleSelection boolean Determines whether simultaneous multiple choice of items is available. Default: false
list_picker.receivedMessage object + An object that describes a received message of a list items selection by the user
list_picker.receivedMessage.title string + A title that is displayed when a customer receives a message
list_picker.receivedMessage.subtitle string + A subtitle that is displayed when a customer receives a message
list_picker.receivedMessage.style string + Defines an item style. The default is "icon". Available values: "icon" / "small" / "large"
list_picker.replyMessage object + An object in where is described how to display a message after a reply
list_picker.replyMessage.title string + ЗA title that is displayed when the message has been sent by the user
list_picker.replyMessage.subtitle string + A subtitle that is displayed when the message has been sent by the user
list_picker.replyMessage.style string + Defines an item style. The default is "icon". Available values: "icon" / "small" / "large"

Adding an item to an Image List Picker

Image List Picker

To expand Image List Picker, with a new item there’s need to be added the following objects to the arrays items[]and images[]:

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

Time Picker

The date and time picker function allows to provide to your customers a convenient tool for scheduling an appointment, meeting or event.
The official documentation of Apple Business Chat: Time Picker

Time Picker

A Time Picker Example

The task Reference in a State Diagram Attachments: timePicker.

{
    "abc": {
        "type": "time_picker",
        "time_picker": {
            "event": {
                "identifier": "1", 
                "location": { 
                    "latitude": 37.7725,
                    "longitude": -22.4311,
                    "radius": "2",
                    "title": "Building One"
                },
                "timeslots": [
                    {
                        "duration": 3600,
                        "identifier": "5",
                        "startTime": "2020-04-01T15:30+0000"
                    },
                    {
                        "duration": 3600,
                        "identifier": "7",
                        "startTime": "2020-04-02T08:30+0000"
                    },
                    {
                        "duration": 3600,
                        "identifier": "9",
                        "startTime": "2020-04-03T21:30+0000"
                    }
                ],
                "timezoneOffset": 0,
                "title": "Schedule an Appointment"
            },
            "receivedMessage": {
                "style": "icon",
                "title": "Please pick a time",
                "subtitle": "This should be 10:00am for -7h users"
            },
            "replyMessage": {
                "style": "icon",
                "title": "Thank you!"
            }
        }
    }
}

Time Picker parameters description

Parameter Type Required Description
type string + A type of an object to send
time_picker object + An object in where all Time Picker parameters are described
time_picker.event object + An object in where all events are described
time_picker.event.identifier string + An item ID that is sent to Corezoid when it has been selected by the client
time_picker.event.location object An object in where an event location is described
time_picker.event.location.latitude double Location latitude
time_picker.event.location.longitude double Location longitude
time_picker.event.location.radius double Location radius (in meters). This field is used whether there’s no latitude and longitude
time_picker.event.location.title string + An item’s title
time_picker.event.timeslots array An array of timeslots
time_picker.event.title string + An item’s title
time_picker.event.timeslots[].duration integer A time slot duration (in seconds)
time_picker.event.timeslots[].startTime double + An event start time, a date in format UTC (ISO 8601). An example: 2017-05-26T08:27:55+00:00, 2017-05-26T08:27:55+0000, or 2017-05-26T08:27:55Z
time_picker.event.timeslots[].identifier string + An item ID that is sent to Corezoid when it has been selected by the client
time_picker.event.event.timezoneOffset integer Minutes quantity from GMT, that settles an event location time zone. If it’s not defined, the time is displayed according to the current client’s time zone. If defined, the time is displayed according to the event time zone, independently from the client’s location
time_picker.receivedMessage object + An object that describes a received message from a list of items selected by the user
time_picker.receivedMessage.title string + A title that is displayed when a customer receives a message
time_picker.receivedMessage.subtitle string + A subtitle that is displayed when a customer receives a message
time_picker.receivedMessage.style string + Defines an item style. The default is "icon". Available values: "icon" / "small" / "large"
time_picker.replyMessage object + An object where it is described how to display a message after a reply
time_picker.replyMessage.title string + A title that is displayed when the message has been sent by the user
time_picker.replyMessage.subtitle string + A subtitle that is displayed when the message has been sent by the user
time_picker.replyMessage.style string + Defines an item style. The default is "icon". Available values: "icon" / "small" / "large"

Adding an item to a Time Picker

Time Picker

To expand the date and time selection list - Time Picker, with a new item there’s need to be added the following object to the array timeslots:

"timeslots": [
     {
             "duration": 3600, 
             "identifier": "1",
             "startTime": "2020-04-1T15:30+0000" 
        }
]

Rich Link

Allows to send messages with images and videos to clients.

The official documentation of Apple Business Chat: Rich Link

Rich Link

A Rich Link Example

The task Reference in a State Diagram
Attachments: richLink.

{
    "abc": {   
        "type": "rich_link",
        "rich_link": {
            "richLinkData": {
                "url": "https://www.corezoid.com/",
                "title": "Welcome to Corezoid!",
                "assets": {
                    "image": {
                        "data": "<…code img in base64…>",
                        "mimeType": "image/png"
                    }
                }
            }
        }
     }
}

Rich Link parameters description

Parameter Type Required Description
type string + A type of an object to send
rich_link object + An object in where all Rich Link parameters are described
rich_link.richLinkData object + An object that contains data to form an object
richLinkData.url string + A link the customer will follow after “tapping” the item
richLinkData.title string + An item’s title
richLinkData.assets object + An object in where an image or a video is described
richLinkData.assets.image object + An object in where an image is described
richLinkData.assets.image.data string + Base64 that presents an item which is used
richLinkData.assets.image.mimeType string + MimeType, for example: image/jpeg, image/png
richLinkData.assets.video object + An object in where a video is described
richLinkData.assets.video.url string + A link to a video
richLinkData.assets.image.mimeType string + MimeType, for example: video/mp4, video/mpeg

It’s possible to convert an image to base64 in the online converter, for example:

Apple Pay

Customers will be able to pay your goods and services right from Apple Business Chat, without having to go to any external sites or fill in the card data.

The official documentation of Apple Business Chat: Apple Pay

Rich Link

Rich Link

An Apple Pay Example

The task Reference in a State Diagram Attachments: applePay.

{
   "abc": {
       "type": "apple_pay_request",
       "apple_pay_request": {
           "receivedMessage": {
               "title": "{{title}}",
               "subtitle": "{{subtitle}}",
               "style": "icon"
           },
           "payment": {
               "paymentRequest": {
                   "lineItems": [
                       {
                           "label": "Item 1",
                           "amount": "0.01",
                           "type": "final"
                       },
                       {
                           "label": "Item 2",
                           "amount": "0.01",
                           "type": "final"
                       }
                   ],
                   "total": {
                       "label": "Your Total",
                       "amount": "0.02",
                       "type": "final"
                   },
                   "applePay": {
                       "merchantIdentifier": "{{merchantIdentifier}}",
                       "supportedNetworks": [
                           "amex",
                           "visa",
                           "discover",
                           "masterCard",
                           "chinaUnionPay",
                           "interac",
                           "privateLabel"
                       ],
                       "merchantCapabilities": [
                           "supportsDebit",
                           "supportsCredit", 
                           "supportsEMV", 
                           "supports3DS"            
                       ]
                   },
                   "merchantName": "{{merchantName}}",
                   "countryCode": "US", 
                   "currencyCode": "USD", 
                   "requiredBillingContactFields": [
                       "postalAddress"
                   ],
                   "requiredShippingContactFields": [
                       "postalAddress",
                       "name",
                       "phoneticName",
                       "phone",
                       "email"
                    ]
               },
               "endpoints": {
                   "paymentGatewayUrl": "https://botplatform.corezoid.com/paymentGateway" 
               }
           }
       }  
   }
}

Apple Pay in Business Chat parameters description

Parameter Type Required Description
type string + A type of an object to send
apple_pay_request object + An object in where request parameters are described
apple_pay_request.payment object + An object in where invoice parameters are described
apple_pay_request.payment.paymentRequest object + An object in where invoice parameters are described
apple_pay_request.paymentRequest.lineItems array + A list of goods/services, from where formed an invoice
apple_pay_request.paymentRequest.lineItems[].label string + A brief product/service description
apple_pay_request.paymentRequest.lineItems[].amount string + Product/service amount
apple_pay_request.paymentRequest.lineItems[].type string Indicates whether an order is final or if funds need to be frozen. Available values: "final" / "pending"
apple_pay_request.paymentRequest.total object + An object that contains total payment amount
apple_pay_request.paymentRequest.total.type string A value that indicates whether the item is final or pending
apple_pay_request.paymentRequest.total.amount string + Total payment amount
apple_pay_request.paymentRequest.total.label string + A brief invoice description
apple_pay_request.paymentRequest.applePay object + An object in where an Apple Pay configuration is described
apple_pay_request.paymentRequest.applePay.merchantIdentifier string + A merchant ID that has been indicated during the registration in Apple Business Chat
apple_pay_request.paymentRequest.applePay.supportedNetworks array + A list of supported payment Networks through which payment will occur. Available values: "amex" / "visa" / "discover" / "masterCard" / "chinaUnionPay" /"interac" / "privateLabel"
apple_pay_request.paymentRequest.applePay.merchantCapabilities array + Possible payment methods. Available values: "supportsDebit" / "supportsCredit" / "supportsEMV" / "supports3DS"
apple_pay_request.paymentRequest.merchantName string + Your merchant name
apple_pay_request.paymentRequest.countryCode string + A merchant country code in format ISO 3166
apple_pay_request.paymentRequest.currencyCode string + An invoice currency code in format ISO 4217
apple_pay_request.paymentRequest.requiredBillingContactFields array A client’s payment data list, required for the invoice payment. An available value: "postalAddress". If the value is empty - the information isn’t requested
apple_pay_request.paymentRequest.requiredShippingContactFields array A client’s contact details list, required for the invoice payment. Available values: "postalAddress" / "name" / "phoneticName" / "phone" / "email"
apple_pay_request.payment.endpoints object + An object in where payment processing information is described
apple_pay_request.payment.endpoints.paymentGatewayUrl string + A URL for processing payment through a payment provider. It should always be indicated: "https://botplatform.corezoid.com/paymentGateway"
A Dynamic Invoice
Bot Platform supports a dynamic invoice formation for Apple Pay. To manage it, use a task with the Reference: invoice from the State Diagram Attachments as an instance and customize it according to your needs.

An items array example to form a dynamic invoice

"items": [
    {
        "title": "...",
        "quantity": "...",
        "total": "..."
    },
    {
        "title": "...", 
        "quantity": "...",
        "total": "..."
    }
]

App Extension Call

This option allows to call a function/window from the iOS-application, to expand Apple Business Chat capabilities.

The official documentation of Apple Business Chat: App Extension Call

App Extension Call

An App Extension Call Example

The task Reference in a State Diagram Attachments: appExtensionCall.

{
   "abc": {
       "type": "app_extension_call",
       "interactiveData": {
           "appId": 123456789,
           "appName": "Package Delivery",
           "URL": "?name=WWDC%20Goodies&deliveryDate=09-06-2017&destinationName=Moscone%20Convention%20Center&street=747%20Howard%20St&state=CA&city=San%20Fransisco&country=USA&postalCode=94103&latitude=37%2E7831&longitude=%2D122%2E4041&extraCharge=15%2E00",
           "bid": "com.apple.messages.MSMessageExtensionBalloonPlugin:WRS8W2ZKCT:com.example.apple-samplecode.PackageDeliveryWRS8W2ZKCT.MessagesExtension",
           "sessionIdentifier": "{{uuid}}",
           "receivedMessage": {
               "title": "WWDC Goodies",
               "subtitle": "Scheduled for delivery - Today",
               "secondarySubtitle": "",
               "tertiarySubtitle": "",
               "imageTitle": "",
               "imageSubtitle": ""
           },
           "useLiveLayout": true
       },
       "attachments": []
   }
}

App Extension Call parameters description

Parameter Type Required Description
type string + A type of an object to send
interactiveData object + An object in where an interactive message is described
interactiveData.appId string + An iMessage extension ID from App Store
interactiveData.appName string + An iMessage extension name
interactiveData.URL string + A deep link that is used by the customer to call an iMessage extension
interactiveData.bid string + An iMessage extension ID
interactiveData.sessionIdentifier string + A background session ID
receivedMessage.title object + An object in where is described how to display a message upon receiving
receivedMessage.title string + An item’s title
receivedMessage.subtitle string An item subtitle
receivedMessage.imageTitle string An attached image name
receivedMessage.imageSubtitle string An attached image subtitle
interactiveData.useLiveLayout boolean + A parameter that determines whether iMessage application should use Live Layout. Default: true

OAuth 2.0 Request

Verify your customers according to the protocol OAuth 2.0 through your own or external services.
The official documentation of Apple Business Chat: OAuth 2.0 Request

OAuth 2.0 Request

OAuth 2.0 Request

The Authentication Process Architecture

OAuth 2.0 Request

Was this article helpful?