设置Facebook聊天扩展的主URL
根据Facebook文档,“要让你的机器人出现在抽屉中,供添加它的人使用,你必须设置它的主页URL。” 我正在按照文档设置域白名单,然后设置主URL设置Facebook聊天扩展的主URL,facebook,facebook-messenger,facebook-messenger-bot,Facebook,Facebook Messenger,Facebook Messenger Bot,根据Facebook文档,“要让你的机器人出现在抽屉中,供添加它的人使用,你必须设置它的主页URL。” 我正在按照文档设置域白名单,然后设置主URL # add domain to whitelist curl -X POST -H "Content-Type: application/json" -d '{ "whitelisted_domains":[ $URL ] }' "https://graph.facebook.com/v2.6/me/messenger_profil
# add domain to whitelist
curl -X POST -H "Content-Type: application/json" -d '{
"whitelisted_domains":[
$URL
]
}' "https://graph.facebook.com/v2.6/me/messenger_profile?access_token=$ACCESS_TOKEN"
# set domain as home URL
curl -X POST -H "Content-Type: application/json" -d '{
"home_url" : {
"url": $URL,
"webview_height_ratio": "tall",
"in_test":true
}
}' "https://graph.facebook.com/v2.6/me/messenger_profile?access_token=$ACCESS_TOKEN"
两者都返回一条成功消息
{
"result":"success"
}
但是当我通过运行
# get home URL
curl -X GET "https://graph.facebook.com/v2.6/me/messenger_profile?fields=home_url&access_token=$ACCESS_TOKEN"
# get existing whitelist domains
curl -X GET "https://graph.facebook.com/v2.6/me/messenger_profile?fields=whitelisted_domains&access_token=$ACCESS_TOKEN"
我得到一个奇怪的反应
{"data":[]}%
我是否遗漏了一个步骤,或者get whitelisted domains和Home URL的响应是否已中断?结果表明,响应未正确显示在我的终端中。我通过邮递员提出了同样的请求,它正确地显示了白名单上的域名。我花了一段时间才弄明白这一点,希望这能帮助任何有同样问题的人