即使它具有发布到页面的publish_stream,offline_access和manage_pages权限(以及正确的访问令牌),我也无法通过我的Facebook应用程序发布到我的网站的Facebook页面墙 .
该应用程序能够发布到 '/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)
1 回答
我在这个问题中将我的解决方案发布到 get the right access token :How to get the access token to post on behalf of a facebook page via a custom application?