我有一个聊天机器人,以前可以正常工作,但是上周,它停止回答与之交互的某些人,而有些人则继续正常进行。 然后两天后,它返回了所有客户,但仅回答了卡片列表(没有文字,回发选项,图像等)。我尚未更改请求,并使用仍未弃用的Facebook API版本2.10。 那么,facebook系统现在有问题还是它们的API有更改?原因是我正在检查文档,并且我看到的所有重大更改都具有FB中与“ messaging_type”参数有关的默认值。 另外,我认为问题出在ID和令牌上(例如PSID是错误的,但是它如何用卡进行应答)?
这是一个停止工作的请求的示例(此机器人自几个月以来一直工作,并且一直在工作: 请求:
{
"message": {
"text": "To change the language to english, please type 'En'"
},
"recipient": {
"id": "ClientRecipientPSID"
}
}
响应(400个错误的请求):
{
"error": {
"message": "(#2022) Your account is temporarily unavailable. Regain access by logging in from a mobile or web browser.",
"type": "OAuthException",
"code": 2022,
"fbtrace_id": "BeDypKgHKH2"
}
}
虽然这是工作要求的示例(仅卡片列表):
{
"message": {
"attachment": {
"type": "template",
"payload": {
"elements": [{
"title": "ZZZ",
"subtitle": "Hello John I’m ZZZ Bot. Ask me anything and I'll be glad to help you.",
"buttons": [{
"type": "postback",
"title": "Title1",
"payload": "1"
}, {
"type": "postback",
"title": "Title2",
"payload": "2"
}, {
"type": "web_url",
"url": "client_url",
"title": "Title3"
}],
"image_url": "our_img_url",
"default_action": {
"type": "web_url",
"url": "link_to_client_site",
"webview_height_ratio": "tall",
"fallback_url": "link_to_client_site",
"messenger_extensions": true
}
}, {
"title": "ZZZ",
"subtitle": "Click below for more information:",
"buttons": [{
"type": "postback",
"title": "TitleX",
"payload": "371"
}, {
"type": "postback",
"title": "TitleY",
"payload": "372"
}, {
"type": "postback",
"title": "TitleZ",
"payload": "373"
}],
"image_url": "our_img_url",
"default_action": {
"type": "web_url",
"url": "link_to_client_site",
"webview_height_ratio": "tall",
"fallback_url": "link_to_client_site",
"messenger_extensions": true
}
}],
"template_type": "generic"
}
}
},
"recipient": {
"id": "ClientRecipientPSID"
}
}
知道为什么会这样吗?谢谢。
答案 0 :(得分:0)
问题出在应用所有者的帐户而不是客户的帐户。需要重置密码。但是,我们并不认为问题出在所有者帐户上,因为它会回复客户。很抱歉给您带来不便,但是我认为这也是Facebook中的错误,因为如果应用程序所有者帐户未处于活动状态,则该漫游器完全不应该答复,或者要么继续答复,要么不使用卡片答复,而忽略其他消息类型。 / p>