Facebook graph API - OAuth Token

后端 未结 11 1972
小鲜肉
小鲜肉 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 09:46

    Maybe your problem is solved but i yet not found accepted answer from you and maybe this answer helps those who face similar problem

    First we have to Create our Application instance.

    $facebook = new Facebook(array(
      'appId' => '149865361795547',
      'secret' => 'ee827a8df6202e1857b3fc28f3185a61',
      'cookie' => true,
    )); 
    

    easy way to get access_token

    $token = $facebook->getAccessToken();
    

    get page status as you ask in your question

    $response = $facebook->api($pageID . '/feed','get',$token);
    

    thanks..

提交回复
热议问题