我几天来一直遇到特定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,因为它在将其推送到远程服务器之前在本地工作,而我正在测试的用户访问令牌对应用程序有效并且尚未过期。我们欢迎所有的建议!
答案 0 :(得分:0)
我建议使用你的uid代替我()因为我猜你离开当地环境时facebook并没有正确地抓住我()。
我刚刚在我的图形api资源管理器上尝试了你的调用并没有遇到任何问题,因为你没有得到权限错误,它必须是facebook不知道谁是“我()”。
仔细检查您在工作环境中登录Facebook /尝试使用您的uid运行呼叫。