【发布时间】:2012-09-07 19:43:15
【问题描述】:
我无法通过我的 facebook 应用程序发布到我网站的 facebook 页面墙,即使它具有发布到页面的 publish_stream、offline_access 和 manage_pages 权限(连同其正确的访问令牌)。
应用程序可以发布到 '/page_id/links/',但不能发布到 '/page_id/feed/'。
请看下面的代码:
graph = facebook.GraphAPI(settings.FB_PAGE_ACCESS_TOKEN_FOR_FB_APP)
attachment = {}
message = 'Hello! check the link!'
site = Site.objects.get_current()
attachment['name'] = '%s' % idea.title
attachment['link'] = 'http://%s%s' %(site,idea.get_absolute_url())
attachment['caption'] = 'addressing problem "%s"' % idea.problem
attachment['description'] = '%s' % striptags(idea.desc)
attachment['properties'] = {'See more': {'text':'Featured ideas', 'href':'http://%s' % site}}
# this works; posts to /fbpage/links/
graph.put_object(settings.FACEBOOK_PAGE, "links", message=message, **attachment)
# this does not work; posts to /fbpage/feed/
graph.put_wall_post(message, attachment, settings.FACEBOOK_PAGE)
【问题讨论】:
-
没有错误!操作成功,但我在墙上看不到任何东西,但我看到顶部有一个通知计数器,当我点击它时它消失了,没有显示任何内容。
-
通过调试工具检查您发布的链接,并在您访问 facebook.com 时尝试直接发布 - 您是否收到任何消息,表明该域已被阻止?
-
哦!得到错误!我使用的可能是一个非常通用的另一个访问令牌(不是 fb 页面的),它在发布时没有抛出任何错误!可能是贴到别的地方了!但是链接确实显示正确!很奇怪!
标签: python django facebook-graph-api