即使它有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)
答案 0 :(得分:0)
我在此问题中将解决方案发布到获取正确的访问令牌: How to get the access token to post on behalf of a facebook page via a custom application?