Invalid API key Exception Facebook Php Sdk FQL

。_饼干妹妹 提交于 2019-12-24 14:03:35

问题


This code:

    $fql2 = "SELECT uid, name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = xxxxxxxxx)";

$params = array(
    'method' => 'fql.query',
    'access_token' => $user->accessToken,
    'query' => $fql2,
    'callback'  => ''
);

$result = $facebook->api($params);
var_dump($result);

Gives me error: Uncaught Exception: 101: Invalid API key

My appId and secret are correct. I have checked it by executing $facebook->api('/me') which works perfectly alright. My access token is alright too with all required permissions. There's some problem with the way i'm trying to call the api to execute fql query.


回答1:


I think you have to write $user->getAccessToken();



来源:https://stackoverflow.com/questions/14205935/invalid-api-key-exception-facebook-php-sdk-fql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!