拥有Php(#100)的Facebook机器人试图访问节点类型(Page)上不存在的字段(消息) [英] Facebook bot with Php (#100) Tried accessing nonexisting field (messages) on node type (Page)
问题描述
我正在尝试使用PHP创建Facebook机器人,但是当我尝试打开时 https://graph.facebook.com/v3. 2/me/messages?access_token = MY-ACCESS-TOKEN
I'm trying to make Facebook bot with PHP, but when i try to open https://graph.facebook.com/v3.2/me/messages?access_token=MY-ACCESS-TOKEN
我收到此错误消息.
{ 错误": { "message":(#100)尝试访问节点类型(Page)上不存在的字段(消息)", "type":"OAuthException", 代码":100, "fbtrace_id":"FsRWv82pTHO"
}
{ "error": { "message": "(#100) Tried accessing nonexisting field (messages) on node type (Page)", "type": "OAuthException", "code": 100, "fbtrace_id": "FsRWv82pTHO"
} }
另外,当我打开我的代码时,我得到了这个错误.
Also when i open my code i got this error.
注意:试图获取非对象的属性
Notice: Trying to get property of non-object in
/storage/ssd3/943/6474943/public_html/index.php on line 11
推荐答案
您正在使用页面访问令牌并尝试获取/{your-page}/messages
,这似乎仅是POST请求的有效端点: https://developers.facebook.com/docs/graph-api/reference/page/.
You are using a page access token and trying to get /{your-page}/messages
, that seems to be a valid endpoint only for POST requests: https://developers.facebook.com/docs/graph-api/reference/page/.
您正在寻找的是/me/conversations
: https ://developers.facebook.com/docs/graph-api/reference/page/conversations/.
这篇关于拥有Php(#100)的Facebook机器人试图访问节点类型(Page)上不存在的字段(消息)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!