TORM JSON 架构
此页面提供针对以下 TORM 富媒体元素的 JSON 架构:
- 列表选取器
- 快速回复
- 时间选取器
- 富链接
- 自适应卡
这些是可在脚本中使用的 TORM 元素。您可以在 SNIPPET 操作中构建它们,以便发送给联系人 。在使用元素前,请验证您正在使用的数字渠道 支持该元素。
您可以使用呼出 API 直接发送这些元素。此页面上的 TORM 示例显示对于呼出 API 的 messageContent 参数要遵循的架构。
富链接
{
"type": "RICH_LINK",
"fallbackText": "Text sent if rich message is not available on external platform",
"payload": {
"media": {
"fileName": "place-kitten.jpg",
"url": "https://placekitten.com/200/300",
"mimeType": "image/jpeg"
},
"title": {
"content": "Check our new gadget!"
},
"url": "https://www.google.com"
}
}
列表选取器
{
"type": "LIST_PICKER",
"fallbackText": "Text sent if rich message is not available on external platform",
"payload": {
"title": {
"content": "Choose a color!"
},
"text": {
"content": "What is your favourite color?"
},
"actions": [
{
"type": "REPLY_BUTTON",
"icon": {
"fileName": "place-kitten.jpg",
"url": "https://placekitten.com/200/300",
"mimeType": "image/jpeg"
},
"text": "red",
"description": "Like a tomato",
"postback": "/red"
},
{
"type": "REPLY_BUTTON",
"icon": {
"fileName": "place-kitten.jpg",
"url": "https://placekitten.com/200/300",
"mimeType": "image/jpeg"
},
"text": "Green",
"description": "Like an apple",
"postback": "/green"
}
]
}
快速回复
{
"type": "QUICK_REPLIES",
"fallbackText": "Text sent if rich message is not available on external platform",
"payload": {
"text": {
"content": "Hello, we will deliver the package between 12:00 and 16:00. Please specify which day."
},
"actions": [
{
"type": "REPLY_BUTTON",
"text": "Today",
"postback": "{\"id\":\"1\"}"
},
{
"type": "REPLY_BUTTON",
"text": "Tomorrow",
"postback": "{\"id\":\"2\"}"
}
]
}
}
时间选取器
{
"type": "TIME_PICKER",
"fallbackText": "Text sent if rich message is not available on external platform",
"payload": {
"title": {
"content": "Check our new gadget!"
},
"timeSlots": [
{
"id": "unique-id",
"duration": 3600,
"startTime": "2017-05-26T08:27:55+00:00"
}
],
"location": {
"title": {
"content": "Check our new gadget!"
},
"latitude": 44.44,
"longitude": 55.55,
"radius": 33.3
}
}
}
自适应卡
可使您发送自适应卡。仅在数字 与Digital Experience相关的任何渠道、联系或技能。聊天渠道 联系人与坐席或机器人交互的一种方式。通道可以是语音、电子邮件、聊天、社交媒体等。上支持自适应卡。
{
"type": "ADAPTIVE_CARD",
"fallbackText": "Url sent: https://placekitten.com",
"payload": {
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.5",
"body": [{
"type": "Image",
"url": "https://placekitten.com/200/300",
"spacing": "none",
"size": "stretch"
}],
"actions": [{
"type": "Action.OpenUrl",
"title": "Show me the cats!",
"url": "https://placekitten.com"
}]
}
}