Invalid API key Exception Facebook Php Sdk FQL

2019-08-02 23:01发布

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条回答
我欲成王,谁敢阻挡
2楼-- · 2019-08-02 23:11

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

查看更多
登录 后发表回答