【问题标题】:Facebook Graph API - (#200) Permissions error on Page PostFacebook Graph API - (#200) Page Post 权限错误
【发布时间】:2015-12-01 13:42:23
【问题描述】:

我想从 JavaScript 发布到 Facebook 页面提要(就好像它来自页面一样)。我登录正常,但是当我尝试发布时,它给出了错误

"错误:对象 代码:200 消息:“(#200)权限错误” 类型:“OAuthException”

在登录时,身份验证响应带有以下我认为足够的权限 -

“email,contact_email,manage_pages,publish_pages,publish_actions,public_profile”。”

请问我怎样才能让它工作?

主要部分(plunk):

function postToMembers(){

    var access_token1 = FB.getAuthResponse()['accessToken'];

    var body = 'Post from code test';
    FB.api('/41622-PAGEID-34/feed', 'post', { message: body, access_token: access_token1 }, function(response) {
      if (!response || response.error) {
        console.log(response); 
      } else {
        alert('Post ID: ' + response.id);
      }
    });

};


function loginAndPost(){
    FB.login(function(response) {
       if (response.authResponse) {
         //Log auth permissions (in the response)
         console.log(response);
         FB.api('/me', function(response) {
          console.log('Successful login for: ' + response.name);
          document.getElementById('status').innerHTML =
            'Thanks for logging in, ' + response.name + '!';
        });

        postToMembers();

       } else {
         console.log('User cancelled login or did not fully authorize.');
       }
     }, {scope: 'publish_actions,publish_pages,manage_pages', return_scopes: true});
};

有关信息,我查看了文档 here、here 和 here 以及许多 StackOverflow 帖子,但无法继续。

【问题讨论】:

    标签: javascript facebook-graph-api


    【解决方案1】:

    没有名为“contact_email”的权限,只有“email”。

    话虽如此,您需要一个页面令牌才能“作为页面”发布。使用/me/accounts 为您的页面获取页面令牌。权限错误很可能意味着您没有适当的权限来使用您的访问令牌发布到页面。确保它是您管理的页面,并确保访问令牌包含publish_pages 权限。您可以在调试器中调试您的访问令牌:https://developers.facebook.com/tools/debug/

    另外,请确保您正在尝试使用应用管理员。未经审查,这些额外权限仅适用于在应用程序中具有角色的用户。请参阅文档中有关登录审查的信​​息:https://developers.facebook.com/docs/facebook-login/review

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-07
      • 1970-01-01
      相关资源
      最近更新 更多