我探索了 smooch.io。向 smooch.io 发送富消息的格式如下:
{
"role": "appMaker",
"type": "carousel",
"items": [{
"title": "Tacos",
"description": "Description",
"mediaUrl": "http://example.org/image.jpg",
"actions": [{
"text": "Select",
"type": "postback",
"payload": "TACOS"
}, {
"text": "More info",
"type": "link",
"uri": "http://example.org"
}]
}, {
"title": "Ramen",
"description": "Description",
"mediaUrl": "http://example.org/image.jpg",
"actions": [{
"text": "Select",
"type": "postback",
"payload": "RAMEN"
}, {
"text": "More info",
"type": "link",
"uri": "http://example.org"
}]
}]
}
但是当我通过 api.ai 将此 JSON 响应发送到 smooch.io 时,它会出错。虽然它很容易显示简单的短信。我如何将此 json 消息作为对象发送给 smooch。有没有办法像 Facebook 对象一样发送它?我想要的只是向用户发送轮播。