首页 文章

无法从messenger api(facebook)发送通用模板

提问于
浏览
0

我正在开发一个聊天机器人信使facebook,我已经有了问候语,一个菜单(还没有工作),以及一个入门按钮,当我尝试测试一个通用模板,如果我改变响应,它什么都不做,一个简单的文本,它响应该文本,但通用模板不,我从这里复制示例:https://developers.facebook.com/docs/messenger-platform/thread-settings

我不知道为什么不能得到通用模板,如果我配置响应图像,按钮,文本,所有这些都被发送,但模板没有,这是我如何配置共鸣:

$response = '{
  "recipient":{
    "id":"'.$senderId.'"
  },
  "message":{
    "attachment":{
      "type":"template",
      "payload":{
        "template_type":"generic",
        "elements":[
           {
            "title":"Sin saber, vivió casi un mes entre muertos",
            "image_url":"https://diario.mx/imagesnotas/2017/01/LOC1307270af08088b_0.jpg",
            "subtitle":"Desde el lunes empezó a hacer oración para el descanso de las almas torturadas y sepultadas, afirma",
            "default_action": {
              "type": "web_url",
              "url": "https://diario.mx/Local/2017-01-05_f62a689b/sin-saber-vivio-casi-un-mes-entre-muertos/",
              "messenger_extensions": true,
              "webview_height_ratio": "tall",
              "fallback_url": "https://diario.mx/"
            } ,
            "buttons":[
              {
                "type":"web_url",
                "url":"https://diario.mx/",
                "title":"Ir a diario.mx"
              },{
                "type":"postback",
                "title":"Start Chatting",
                "payload":"DEVELOPER_DEFINED_PAYLOAD"
              }              
            ]      
          }
        ]
      }
    }
  }
}';

由quick_replies选项中的自定义有效负载“masleidas”进行操作

1 回答

  • 0

    根据文档字幕,字符限制为80,您的示例在字幕中显示99个字符 . 所以我觉得这个角色太多了 .

    您是否从FB API返回到聊天机器人的任何错误?

相关问题