1.まず、FacebookAppのIDとシークレットキーをメモします。
https://developers.facebook.com/apps/2.コードを取得する
$redirect_uri={FacebookAppのURL};echo "https://graph.facebook.com/oauth/authorize?client_id={FACEBOOK_APP_ID}&scope=publish_actions,manage_pages&redirect_uri=".urlencode($redirect_uri);
$code={上でとったコード};
3.自分のトークン発行
$token_url = "https://graph.facebook.com/oauth/access_token?client_id={FACEBOOK_APP_ID}&redirect_uri=".urlencode($redirect_uri)."&client_secret={FACEBOOK_SECRET}&code=".($code);$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $token_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$token = curl_exec($ch);
echo $token;
$access_token={自分のトークン};
4.Facebookページのトークン取得
echo "https://graph.facebook.com/me/accounts?access_token=".$access_token;もしくは
https://developers.facebook.com/tools/explorer/
ここに自分のトークンをいれて、/me/accounts
で自分が管理しているFacebookページ全てのトークンを取得出来ました。