0
当我把这个json数据与PHP curl发送到Facebook Messenger Bot api时,它工作正常。facebook messenger api,模板不起作用
$ jsonData = '{ “收件人”:{ “ID”:“' $发送者。 ' ” }, “消息”:{ “文”:“'。$ OBJ'” } }';
但是,当我使用FB页面的模板。模板不起作用
$jsonData = '{
"recipient":{
"id":"'.$sender.'"
},
"message":{
"attachment":{
"type":"template",
"payload":{
"template_type":"generic",
"elements":[
{
"title":"Hello",
"image_url":"http://icons.iconarchive.com/icons/paomedia/small-n-flat/1024/sign-check-icon.png",
"subtitle":"Title",
"default_action": {
"type": "web_url",
"url": "https://google.com",
"messenger_extensions": true,
"webview_height_ratio": "tall",
"fallback_url": "https://google.com/"
},
"buttons":[
{
"type":"web_url",
"url":"https://google.com",
"title":"View Website"
},{
"type":"postback",
"title":"Start Chatting",
"payload":"DEVELOPER_DEFINED_PAYLOAD"
}
]
}
]
}
}
}
}';
我想编码为Json,替换按钮,没有任何反应。 Facebook模板在Messenger更新后不起作用,或者我需要使用新参数?