使用 @Name
标记您的 Facebook 帖子会出现在您的信息墙上。
我的一个 friend 发布了一个链接并在其中标记了我:
关于Graph API documentation ,当我点击我的动态消息链接(Ctrl + F: Profile feed
)时,我可以看到这篇文章:
...
{
"id": "XXX",
"from": {
"name": "XXX",
"id": "XXX"
},
"to": {
"data": [
{
"name": "XXX",
"id": "XXX"
},
{
"name": "Christophe Maillard",
"id": "XXX"
}
]
},
"message": "The startup Guide (cc XXX, Christophe Maillard)",
"link": "http://mashable.com/2012/06/27/startup-guide-1000-users/",
"name": "How to Get to Your First 1,000 Users",
"caption": "mashable.com",
"description": "With the help of some smart marketers and entrepreneurs, we're created a clear outline for attracting your startup's first 1,000 users.",
...
}
...
此提要的网址是 https://graph.facebook.com/me/feed?access_token=XXX
。
当复制/粘贴给定的访问 token 时 - 在上面的 URL 中被 XXX
替换的 token - 在 debugger 中,我得到这样的东西:
正如我们所见,访问 token 是由应用 Test_console
生成的,它使用了相当多的作用域。
然后,我转到 Graph API Explorer ,我使用 Get Access Token
按钮生成一个访问 token ,并指定调试器给我的所有范围,即 Test_console
应用程序用于生成其 working 访问 token 。最后,我通过提交 GET 请求访问 URL me/feed
。问题:我在浏览器中看不到标记了我的相关帖子。
我也有自己的应用程序,它的 react 与 Graph API Explorer 完全一样: 我也无法使用 Graph API 在我的信息墙上找到该帖子。
显然,可以使用 Graph API 获取标记了您的帖子,因为 Test_console
应用能够生成适当的访问 token 。但是我怎样才能为我自己的应用获取这样的访问 token ?
最佳答案
您需要为您的应用授予适当的权限。在 graph api explorer https://developers.facebook.com/tools/explorer?method=GET&path=me在应用程序字段(右上角)切换到您的应用程序,以查看当前授予您的应用程序的权限(通过再次单击“获取访问 token ”按钮)。然后确保你添加了正确的(我想你要的是 read_stream)https://developers.facebook.com/docs/authentication/permissions/
关于facebook - 如何获得一个 Facebook 访问 token ,该 token 具有足够的权限来获取标记您的帖子?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11311488/