Facebook graph API - OAuth Token

后端 未结 11 1839
小鲜肉
小鲜肉 2021-01-30 09:16

I\'m trying to retrieve data using the new graph API, however the token I\'m retriving from OAuth doesn\'t appear to be working.

The call I\'m making is as follows;

11条回答
  •  一生所求
    2021-01-30 10:09

    This works for me :-)

    header('Location: https://graph.facebook.com/oauth/access_token?' . http_build_query(array(
        'client_id'     => FB_APP_ID,
        'type'          => 'client_cred',
        'client_secret' => FB_SECRET,
        'code'          => $code)));
    

    Of course you would use file_get_contents instead and parse the token out of the response

提交回复
热议问题