我可以找出在哪里得到我的fb api访问令牌。FB图api不知道从哪里得到我的acces令牌
我从代码:https://developers.facebook.com/docs/php/howto/example_retrieve_user_profile
现在我填写我的APP_ID和我App_secret。但我也需要得到在这条线的acces_token:
$response = $fb->get('/me?fields=id,name', '{access-token}');
什么是ACCES令牌我需要填写在那里,我该如何获得呢?
<?php
session_start();
require_once __DIR__ . '/Facebook/autoload.php';
$fb = new Facebook\Facebook([
'app_id' => 'app-id',
'app_secret' => 'app secret',
'default_graph_version' => 'v2.5',
]);
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->get('/me?fields=id,name', '{access-token}');
} catch (Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch (Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}