如何使用应用程序访问令牌检索所有用户字段?

时间:2012-08-20 11:09:33

标签: facebook-graph-api access-token

根据使用App Access Token的Facebook文档,

虽然App Access Token主要用于代表用户将信息发布回Facebook,但可以使用App Access Token从Facebook检索有限的一组信息。

  • 用户的基本资料信息(身份证,姓名,用户名,性别)

  • 用户的好友及其ID

  • 用户授予您应用的权限

ref:developers.facebook.com/docs/opengraph/using-app-tokens /

但是我无法通过应用程序access_token获得大部分字段。 我向ID为UID1

的用户提供所有用户和朋友的权限和扩展权限

选中为:https://graph.facebook.com/UID1/permissions?access_token=APP_ACCESS_TOKEN

我得到:(1表示授予权限,0表示未授予权限。)

{

   "data": [
  {
     "installed": 1,
     "read_stream": 1,
     "manage_friendlists": 1,
     "read_mailbox": 1,
     "publish_checkins": 1,
     "status_update": 1,
     "photo_upload": 1,
     "video_upload": 1,
     "create_event": 1,
     "rsvp_event": 1,
     "email": 1,
     "xmpp_login": 1,
     "create_note": 1,
     "share_item": 1,
     "publish_stream": 1,
     "ads_management": 1,
     "read_insights": 1,
     "read_requests": 1,
     "manage_notifications": 1,
     "read_friendlists": 1,
     "publish_actions": 1,
     "user_birthday": 1,
     "user_religion_politics": 1,
     "user_relationships": 1,
     "user_relationship_details": 1,
     "user_location": 1,
     "user_likes": 1,
     "user_activities": 1,
     "user_interests": 1,
     "user_education_history": 1,
     "user_online_presence": 1,
     "user_groups": 1,
     "user_events": 1,
     "user_photos": 1,
     "user_notes": 1,
     "user_questions": 1,
     "user_about_me": 1,
     "user_status": 1,
     "friends_birthday": 1,
     "friends_religion_politics": 1,
     "friends_relationships": 1,
     "friends_relationship_details": 1,
     "friends_location": 1,
     "friends_likes": 1,
     "friends_activities": 1,
     "friends_interests": 1,
     "friends_education_history": 1,
     "friends_online_presence": 1,
     "friends_groups": 1,
     "friends_events": 1,
     "friends_photos": 1,
     "friends_notes": 1,
     "friends_questions": 1,
     "friends_about_me": 1,
     "friends_status": 1
  }
   ]
}

然后,我使用APP_ACCESS_TOKEN对以下URL进行API调用,以检索所有可能的信息 https://graph.facebook.com/UID1?fields=id,name,picture,gender,locale,languages,link,username,third_party_id,installed,timezone,updated_time,verified,bio,birthday,cover,currency,education,email,hometown,interested_in,location,political,religion,website,work,relationship_status&access_token=APP_ACCESS_TOKEN

结果我只得到了     {id,name,gender,locale,username,third_party_id,installed,cover,email and picture}。

我能够得到

{ id, name, gender, locale, username, cover and picture } without any access_token.

但Facebook服务器根本没有向我发送所有其他字段

{ location, birthday, relationship_status,languages,link,updated_time,bio,education,hometown,political,religion,work } 

用户已授权该应用程序。现在app_access_token工作正常(我希望如此),这就是为什么我能够得到

 { email, installed and third_party_id } 

但是如何获得休息区。请帮助我。

0 个答案:

没有答案