获取facebook评论返回错误

获取facebook评论返回错误,facebook,facebook-graph-api,review,Facebook,Facebook Graph Api,Review,我首先使用facebook api获取页面令牌 function createSession($app_id,$app_secret){ FacebookSession::setDefaultApplication( $app_id,$app_secret ); $testUserPermissions = array('user_actions.books','user_actions.fitness','user_actions.music','user_ac

我首先使用facebook api获取页面令牌

function createSession($app_id,$app_secret){
    FacebookSession::setDefaultApplication(
    $app_id,$app_secret
    );
    $testUserPermissions = array('user_actions.books','user_actions.fitness','user_actions.music','user_actions.news','user_actions.video','user_birthday','user_games_activity','user_groups','user_hometown','user_interests','user_location','user_relationship_details','user_religion_politics','user_tagged_places','user_videos','user_work_history','read_friendlists','read_page_mailboxes','manage_notifications','read_mailbox','publish_actions','read_stream', 'user_photos','manage_pages','public_profile','user_friends','email','user_about_me','user_activities','user_education_history','user_events','user_likes','user_relationships','user_status','user_website','read_insights','rsvp_event');
    $testUserPath = '/' . $app_id . '/accounts/test-users';
    #$testUserPath = '/100008488695640/accounts/test-users';
    $params = array(
    'installed' => true,
    'name' => 'User test',
    'locale' => 'zh_TW',
    'permissions' => implode(',', $testUserPermissions),
    );
    echo var_dump($params);
    $request = new FacebookRequest(new FacebookSession($app_id . '|' .$app_secret), 'POST', $testUserPath, $params);

    $response = $request->execute()->getGraphObject();
    echo var_dump($response);
    #$testUserId = $response->getProperty('id');
    $testUserAccessToken = $response->getProperty('access_token');
    return new FacebookSession($testUserAccessToken);

}
这是我的代币

然后我使用这个令牌获取评论

$token_值

但它又回来了

{ “错误”:{ “消息”:“(#210)此调用需要页面访问令牌。”, “类型”:“OAutheException”, “代码”:210 } }

如何获取页面令牌


未使用令牌?

请确保您确实在使用页面令牌。将令牌放入调试器中,查看它是否是页面令牌:

有关令牌的更多信息:


当您请求多个权限时,其中一些权限可能与您正在调用的端点协同工作,而另一些权限可能无法协同工作,从而导致此错误


在我的例子中,添加
profile\u pic
权限到
/me?fields=id,first\u name,last\u name,email
导致了此错误。

应用程序id 817943358271981:dog用户id 1404081353236344发出未知过期1424948400(15小时前)有效虚假来源未知范围公共配置文件,基本信息,读取流,读取邮箱,读取页面邮箱,rsvp事件、电子邮件、阅读洞察、管理通知、阅读好友列表、管理页面、发布行动、用户生日、用户宗教政治、用户关系、用户关系详细信息、用户家乡、用户位置、用户喜好、用户活动、用户兴趣、用户教育历史。。。正如我所怀疑的,它的show-this-it-not-show令牌类型看起来不像页面令牌。页面标记包括页面的id。您应该真正减少您的权限。很多。如果你正在使用一个页面标记,但是你得到了这个响应?那么你很可能没有真正使用页面标记…调试器说了什么?你找到了这个问题的解决方案了吗?请帮助。。。