我想在get_object()
中以用户的身份发送朋友的名字,在下面的代码中获取他的公开帖子。但我犯了个错误
raise GraphAPIError(result) facebook.GraphAPIError: (#803) Cannot query users by their username (tayyab.rasheed.545)
user = 'tayyab.rasheed.545' #is giving error
#user = 'BillGates' #is working fine.
# user = 'me' #is working fine.
graph = facebook.GraphAPI(access_token)
profile = graph.get_object(user)
posts = graph.get_connections(profile['id'], 'posts')
为什么会出错?我想我做错了什么。BillGates
和me
运行良好,那么为什么不tayyab.rasheed.545
朋友的简介是https://www.facebook.com/tayyab.rasheed.545
不可能获得任何用户的公开帖子。即使你拥有公开的职位,你也需要获得
user_posts
的授权。你知道吗编辑:请不要改变你的问题,特别是当已经有答案的时候。我的回答是正确的。你不应该得到任何数据的用户谁没有授权你的应用程序无论如何。你知道吗
因为Facebook用v2.0从API中删除了username字段,并且正如错误消息所说的那样,您不能再通过用户名查询用户配置文件了。你知道吗
BillGates
只是一个Facebook页面,而不是一个用户档案。你知道吗(而且
me
首先与用户名无关。)相关问题 更多 >
编程相关推荐