TORM JSON 架构
此页面提供针对以下 TORM 富媒体元素的 JSON 架构:
- 列表选取器
- 快速回复
- 时间选取器
- 富链接
- 自适应卡
这些是可在脚本中使用的 TORM 元素。 您可以在 SNIPPET 操作中构建它们,以便发送给联系人 。 在使用元素前,请验证您正在使用的数字渠道 支持该元素。
您可以使用呼出 API 直接发送这些元素。 此页面上的 TORM 示例显示对于呼出 API 的 messageContent 参数要遵循的架构。
富链接
富链接是带有图像预览和标题的 URL,单击它即可打开 URL。 TORM 富链接有一些基于通道的限制。
{
"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"
}
}
列表选取器
列表选取器是联系人可以从中选择的选项列表。 这些选项通常以叠加方式显示,具有更丰富的格式化功能,例如图标、标题和副标题。 列表选取器通常可实现比快速回复更多的选项。 联系人可以选择多个选项,并且这些选项在对话中持续存在。 TORM 列表选择器有一些基于通道的限制。
{
"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"
}
]
}
快速回复
快速回复是带有按钮的短信。 联系人可单击其中一个按钮。 单击后,其内容将作为呼出发送。 通常,当发送回复时,无法单击其他按钮。 TORM 快速回复有一些基于通道的限制。
{
"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\"}"
}
]
}
}
时间选择器
时间选取器允许您为联系人提供时间选择,例如安排约会。 TORM 时间选取器有一些基于通道的限制。
{
"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
}
}
}
Adaptive Card
Adaptive Cards是 Microsoft 开发的一种独立于平台的发送富媒体的方法。 Adaptive Cards仅在数字 与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"
}]
}
}