几天来,我一直遇到特定 FQL 调用的问题,希望有人能指出我正确的方向,是的,正在要求正确的权限。
使用 PHP SDK,使以下 FQL 多查询工作
$user_fql = urlencode("SELECT uid, first_name, middle_name, last_name, name, birthday_date, hometown_location, current_location, education, religion, political, interests, work FROM user WHERE uid = me()");
$friend_count_fql = urlencode("SELECT friend_count FROM user WHERE uid = me()");
$multiquery = json_encode(array("user" => $user_fql, "friend_count" => $friend_count_fql));
$user = $facebook->api("/fql?q=".$multiquery."&access_token=".$access_token."&format=json-strings");
但是,在进行此 FQL 调用时
$friends_fql = urlencode("SELECT uid, first_name, middle_name, last_name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) LIMIT 10");
$friends = $facebook->api("/fql?q=".$friends_fql."&access_token=".$access_token."&format=json-strings");
抛出以下错误
{"error":{"message":"A user access token is required to request this resource.","type":"OAuthException","code":102}}
以及我们要求的权限
create_note email, friends_birthday, friends_education_history, friends_groups
friends_hometown, friends_interests, friends_likes, friends_location,
friends_relationships, friends_religion_politics, friends_work_history, photo_upload,
publish_actions, publish_stream, read_stream share_item status_update user_birthday
user_education_history, user_hometown, user_likes user_location, user_religion_politics,
user_work_history, video_upload
我不知道为什么获取用户的朋友信息会引发 OAuthException,因为这是在将其推送到远程服务器之前在本地工作,并且我正在测试的用户访问令牌对应用程序有效并且尚未过期。我们欢迎所有的建议!