0
페이스 북의 메신저 봇 API에이 json 데이터를 PHP 컬로 보낼 때 제대로 작동합니다.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 템플릿이 작동하지 않거나 새로운 매개 변수를 사용해야합니까?