长访问令牌和短访问令牌有什么区别?
例如,我正在尝试使用以下方法来获得共同的朋友:
https://graph.facebook.com/$uid1/mutualfriends/$uid2?access_token=$token _
并使用以下函数获取访问令牌:
function getAccessToken(){
$url ='https://graph.facebook.com/oauth/access_token?client_id='.FB_APP_ID.'&client_secret='.FB_SECRET_ID.'&grant_type=client_credentials';
$info = file_get_contents($url);
$clean = clean_up_data($info);
return($clean);
}
但这不起作用,因为令牌无效,尽管如果我使用在Graph API Explorer中找到的访问令牌,它可以工作,但这个令牌变化很大。
那么你将如何获得有效的令牌以允许访问共同的朋友呢?