问题
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