我正在尝试弄清楚如何使用 Graph API 或 FQL 获取用户好友信息
只是为了测试,我想让我的 friend education_histroy
。
为此,我创建了一个测试应用程序,使用
请求扩展权限scope=offline_access,manage_friendlists,friends_work_history,
friends_education_history,friends_about_me
并获得访问 token 以使用 API。
当我使用 /me
查询当前用户时,效果很好。但它对我的 friend 没有任何返回。
我假设如果我请求,比方说friends_work_history
,当我通过 friend 的 id 查询时,额外的字段 (work_history
) 将出现在 friend 的对象中:
https://graph.facebook.com/FRIEND_ID&access_token=TOKEN
但我看到的只是关于该用户( friend )的基本信息。
然后我尝试专门请求该字段:
https://graph.facebook.com/FRIEND_ID?fields=work&access_token=TOKEN
再次没有运气。只返回 friend 的 ID..
我尝试使用 FQL 访问该信息:
返回 work_history = TRUE
而不是数组。那个 friend 肯定有指定的工作经历。
谁能帮助我了解如何使用我的应用和扩展权限获取好友信息?
最佳答案
在大多数情况下,图形 API 是明智的选择。要检索您的 friend 信息,您需要先从用户那里收集一些扩展权限。然后你可以检索到比基本信息更多的信息。
以下是与好友不同类型信息相关的扩展权限列表
friends_about_me
friends_activities
friends_birthday
friends_checkins
friends_education_history
friends_events
friends_games_activity
friends_groups
friends_hometown
friends_interests
friends_likes
friends_location
friends_notes
friends_online_presence
friends_photo_video_tags
friends_photos
friends_relationship_details
friends_relationships
friends_religion_politics
friends_status
friends_subscriptions
friends_videos
friends_website
friends_work_history
希望对您有所帮助:)
关于Facebook Graph API - 获取好友信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5516627/