Facebook bot with Php (#100) Tried accessing nonexisting field (messages) on node type (Page)

馋奶兔 提交于 2020-08-11 03:13:33

问题


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

I got this error message.

{ "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

回答1:


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/.

What you are looking for instead is /me/conversations: https://developers.facebook.com/docs/graph-api/reference/page/conversations/.



来源:https://stackoverflow.com/questions/54234305/facebook-bot-with-php-100-tried-accessing-nonexisting-field-messages-on-nod

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!