微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

通用模板不起作用-IBM Watson和Facebook集成

如何解决通用模板不起作用-IBM Watson和Facebook集成

当前,我正在Facebook页面上开发与IBM Cloud Functions集成的DB2数据库驱动的IBM Watson Assistant聊天机器人。我已经建立了连接,并且能够在Facebook上发送和接收消息。

现在,我正在尝试发送引用Facebook developer doc的通用模板,并在Facebook中实现带有图像,标题和按钮的卡轮播。

我尝试过的事情:根据IBM documentation,我在 output.facebook内部尝试了 message.attachment.payload (在Facebook开发人员文档中指定) 在Watson JSON编辑器中。

{
"output": {
"generic": [{
    "values": [{
        "text": "ok"
    }],"response_type": "text","selection_policy": "sequential"
}],"facebook": {
    "text": "Hi,\n\nWe have a great giveaway for you,but first we’d like for you to follow us so that you can stay updated on the latest news and trends.\n\nPlease take a moment to follow us and let me kNow when you've followed us by typing DONE:\n\n","buttons": [{
        "url": "https://www.facebook.com/ibmcommerce/","type": "web_url","title": "Follow IBM Commerce","messenger_extensions": "false","webview_height_ratio": "full"
    }],"template_type": "generic"
  }
 }
}

我还尝试实施IBM Watson developer forum

中提供的解决方
{
  "output": {
"facebook": {
  "message": {
    "attachment": {
      "type": "template","payload": {
        "text": "Hi,"buttons": [
          {
            "url": "https://www.facebook.com/ibmcommerce/","webview_height_ratio": "full"
          }
        ],"template_type": "button"
      }
     }
    }
   }
  }
 }

这两种解决方案都不适合我。请帮助我弄清楚我的缺失。

我们非常感谢您的帮助。预先感谢!

解决方法

  1. 将您的Webhook更新为四月版本(2020-04-01
  2. 使用output.facebook代替output.integrations.facebook

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。