Facebook API - 在朋友的墙上发帖评论

Cla*_*ell 6 facebook facebook-wall facebook-graph-api facebook-comments

需要一种方法通过Facebook API在朋友的墙上发布评论(我正在使用Python包装器).

考虑两个用户,Alice和Bob.我有两个用户的read_stream和write_stream权限.

>>> alice_graph = GraphAPI(alice_access_token)
>>> bob_graph = GraphAPI(bob_access_token)

# Alice makes a post on her own wall, which returns the objects Graph API id
>>> alice_graph.put_wall_post("test_message", attachment={'name' : 'some_name', 'link' : 'some_link')
{u'id': u'some_facebook_id'}

# Alice can comment
>>> alice_graph.put_comment('some_facebook_id', "test comment")
{u'id': u'some_other_facebook_id'}

# But Bob cannot comment
>>> bob_graph.put_comment('some_facebook_id', "test_comment")
*** GraphAPIError: (#100) Error finding the requested story
Run Code Online (Sandbox Code Playgroud)

有趣的是,这只发生在Alice的墙贴有一个attachment. 如果爱丽丝制作一个没有附件的墙贴,只是一条消息,就不会发生这种情况.

关于如何在没有它们的附件和墙贴的墙贴之间,权限可能会有任何不同,我完全感到困惑.

谁知道我做错了什么?

Cla*_*ell 0

这种情况最终只发生在爱丽丝身上——而其他用户鲍勃则能够在他们的墙上帖子上发表评论。我把这归因于 Alice 的 Facebook 隐私设置很奇怪。