JSON Schemas for Apple Messages for Business
Use the following schemas when sending messages on your Apple Messages for Business channel. All IDs used for elements in these schemas must be unique. The exception to this is if you're referring to an element you previously defined to make sure an event happens to that specific element, such as with a postback.
List Picker
The ID for a list picker must include the prefix listPIcker_ before the random GUID. Without this prefix, list pickers won't work in Apple Messages for Business. IDs for the elements within a list picker don't need this prefix.
JSON schema for list pickers in Apple Messages for Business
"messageContent": {
"type": "PLUGIN",
"payload": {
"postback": "",
"elements": [
{
"id": "listPicker_067d40c2-9580-49fe-8d7f-947b7e9e675a4",
"type": "MENU",
"elements": [
{
"id": "067d40c2-9580-49fe-8d7f-947b7e9e675a",
"type": "TITLE",
"text": "ListPicker Title"
},
{
"id": "067d40c2-9580-49fe-8d7f-947b7e9e671a",
"type": "BUTTON",
"text": "Choice 1",
"postback": "{\"identifier\": \"067d40c2-9580-49fe-8d7f-947b7e9e671a\"}"
},
{
"id": "067d40c2-9580-49fe-8d7f-947b7e9e672a",
"type": "BUTTON",
"text": "Choice 2",
"postback": "{\"identifier\": \"067d40c2-9580-49fe-8d7f-947b7e9e672a\"}"
}
]
}
]
}
}
Time Picker
The ID for a time picker must include the prefix timePIcker_ before the random GUID. Without this prefix, time pickers won't work in Apple Messages for Business. IDs for the elements within a time picker don't need this prefix.
JSON schema for time pickers in Apple Messages for Business
"messageContent": {
"type": "PLUGIN",
"payload": {
"elements": [
{
"id": "timePicker_067d40c2-9580-49fe-8d7f-947b7e9e675a",
"type": "MENU",
"elements": [
{
"id": "067d40c2-9580-49fe-8d7f-947b7e9e125a",
"type": "TITLE",
"text": "TimePicker Title"
},
{
"id": "b1234",
"type": "BUTTON",
"text": "2022-05-12 08:30 (30 min)",
"postback": "{\"identifier\":\"b1234\",\"startTime\":\"2022-05-12T08:30:00+04:00\",\"durationInSeconds\":1800}"
},
{
"id": "c1234",
"type": "BUTTON",
"text": "2022-05-12 09:30 (30 min)",
"postback": "{\"identifier\":\"c1234\",\"startTime\":\"2022-05-12T09:30:00+04:00\",\"durationInSeconds\":1800}"
}
]
}
]
}
}
Rich Link
The ID for a rich link must include the prefix richLink_ before the random GUID. Without this prefix, rich links won't work in Apple Messages for Business. IDs for the elements within a rich link don't need this prefix.
JSON schema for rich links in Apple Messages for Business
"messageContent": {
"type": "PLUGIN",
"payload": {
"elements": [
{
"id": "richLink_7329c009-4a36-493c-8435-80874a15175e",
"type": "MENU",
"elements": [
{
"id": "7329c009-4a36-493c-8435-80874a1517514",
"type": "FILE",
"filename": "pejsek-a-kocicka.jpg",
"url": "https://www.hrabova.info/wp-content/uploads/2019/02/pejsek-a-kocicka.jpg",
"mimeType": "image/jpeg"
},
{
"id": "7329c009-4a36-493c-8435-80874a1517524",
"type": "BUTTON",
"text": "RichLink Title",
"url": "https://www.seznam.cz/"
}
]
}
]
}
}
Apple Pay Messages
The ID for an Apple Pay message must include the prefix applePayMessage_ before the random GUID. Without this prefix, Apple Pay messages won't work in Apple Messages for Business. IDs for the elements within an Apple Pay message don't need this prefix.
JSON schema for Apple Pay in Apple Messages for Business
"messageContent": {
"type": "PLUGIN",
"payload": {
"postback": "{\"brandId\":1591,\"templateId\":\"d5677255-671b-426f-b4fa-5487ae8a8c81\"}",
"elements": [
{
"id": "applePayMessage_d5677255-671b-426f-b4fa-5487ae8a8c81",
"type": "MENU",
"elements": [
{
"id": "7329c009-4a36-493c-8435-80874a151751",
"type": "TITLE",
"text": "ApplePayMessage Title"
},
{
"id": "7329c009-4a36-493c-8435-80874a151752",
"type": "TEXT",
"text": "Item: 1 CZK",
"mimeType": "text/plain"
}
]
}
]
}
}