如何在Facebook墙上发布新帖子?

时间:2016-08-13 09:02:39

标签: facebook-graph-api

我的应用已获得publish_actions权限的批准,我希望发布到用户的墙上以表达我的用户。我试着像这样调用图形API:

https://graph.facebook.com/v2.7/me/feed?access_token=<token>&method=post&message=Hello

我阅读了facebook文档并且说A user access token with publish_actions permission can be used to publish new posts. 但实际上我无法将消息发布到用户的墙上。我收到的是:

    {
   "error": {
      "message": "Invalid OAuth 2.0 Access Token",
      "type": "FacebookApiException",
      "code": 190,
      "error_subcode": 1732004,
      "is_transient": false,
      "error_user_title": "Invalid Access Token",
      "error_user_msg": "Invalid access token received.",
      "fbtrace_id": "<trace code here>"
          }
   }

我犯了什么错吗?

更新:添加令牌调试器信息的屏幕截图 enter image description here

1 个答案:

答案 0 :(得分:0)

这对我来说很好:https://graph.facebook.com/me/feed?access_token=xxx&method=post&message=test

确保访问令牌有效且包含publish_actions权限,您可以在此处进行测试:https://developers.facebook.com/tools/debug/access_token/