Python 应用程序页面不知道我是管理员?

Python 应用程序页面不知道我是管理员?,python,facebook,facebook-graph-api,tornado,Python,Facebook,Facebook Graph Api,Tornado,不再可用,在过去我使用过它,所以我在页面的应用程序上毫无问题地发布,使用 但我删除了该应用程序,并尝试添加另一个新应用程序,将代码更改为: class MainHandler(BaseHandler, tornado.auth.FacebookGraphMixin): @tornado.web.authenticated @tornado.web.asynchronous def get(self): self.facebook_request("/me/

不再可用,在过去我使用过它,所以我在页面的应用程序上毫无问题地发布,使用

但我删除了该应用程序,并尝试添加另一个新应用程序,将代码更改为:

class MainHandler(BaseHandler, tornado.auth.FacebookGraphMixin):
    @tornado.web.authenticated
    @tornado.web.asynchronous
    def get(self):
        self.facebook_request("/me/applications/developer/", self._on_accounts, access_token=self.current_user["access_token"])

    def _on_accounts(self, account):
        if account is None:
            # Session may have expired
            print "on accounts failed"
            sys.exit()

        print "here we go!"
        print account # this will return me a json
        for acc in account["data"]:
            if acc["id"] == "157547381099830":
                self.facebook_request("/157547381099830/feed", post_args={"message":"hi there!", "link": "http://www.example.com"}, access_token=self.current_user["access_token"], callback=self.async_callback(self._on_page_post))
我能做的只是在我的墙上张贴(更改
self.facebook_请求(/1575473810809830/feed)…
by
self.facebook_请求(/me/feed)…
) 我进入了页面,Facebook知道我是管理员,但如果我使用python代码,它将以普通用户的身份发布流

编辑:问题似乎是Facebook的新规则?当切换到我的名字时,我不能在墙上发布,即使我是管理员

在管理设置中,它被写入:

经理 Abdelouahab可以管理管理员角色、发送消息和创建作为页面的帖子、创建广告和查看见解

但是,情况似乎并非如此,因为当我选择:

您正在以Abdelouahab Abdenour Aliane的身份发布、评论和喜爱内容-更改为Essog社区,然后我可以发布,前提是我切换到Essog社区(因为我阻止了外部用户在墙上发布)


更新:在范围中添加了
manage_pages
,即使这样也不起作用

很抱歉,找到了答案:

  • 第一次没有使用
    管理页面
    ,所以我使用了页面令牌
  • 要作为页面而不是当前用户执行以下操作,必须使用页面的访问令牌,而不是通常用于读取图形API对象的用户访问令牌

    (已删除并开始新页面)

    这将有助于:

    for acc in account["data"]:
        if acc["id"] == "345632575539519":
            print acc["access_token"]
            self.facebook_request("/345632575539519/feed", post_args={"message":"hello", "link": "http://www.example.com"}, access_token=acc["access_token"], callback=self.async_callback(self._on_page_post))