2011-12-08 90 views
3

我需要幫助才能獲取Facebook用戶的電子郵件。這是我所做的。如何使用graph api查詢Facebook用戶的電子郵件?

https://graph.facebook.com/me?scope=email&access_token=xxxxxxxxxxxxxxxx

結果我回到中沒有任何郵件。

  { 
       "id": "7027110", 
       "name": "John Mike", 
       "first_name": "John", 
       "last_name": "Mike", 
       "link": "http://www.facebook.com/john.mike", 
       "username": "john.mike", 
       "location": { 
        "id": "11241875545", 
        "name": "Oakland, New Jersey" 
       }, 
       "gender": "male", 
       "timezone": -5, 
       "locale": "en_US", 
       "verified": true, 
       "updated_time": "2011-12-07T16:53:47+0000" 
      } 

也試圖將scope = email更改爲fields = email,仍然無效。缺少什麼,請幫助我

+0

我不認爲你的意思是能夠獲得這些信息。它對普通用戶不可用。它也會導致嚴重的垃圾郵件問題。 – Polynomial

+0

這可能是因爲他們沒有公開電子郵件:(這裏試試這個: 'https://graph.facebook.com/me/fql?access_token=<你的訪問令牌>&q =選擇%20name,email %20from%20user%20where%20uid = me()' 或 'https://graph.facebook.com/me/fql?access_token=<您的訪問令牌>&q =選擇%20name,電子郵件%20from%20user% 20 where%20uid%20in%20(select%20uid2%20from%20friend%20where%20uid1%20 = me())' –

+0

無論我做了什麼都是正確的,但是,我沒有權限查詢用戶的電子郵件。第一次用戶登錄時,我需要詢問他是否允許我進入。 – qinking126

回答

1

您是否從用戶那裏獲得email擴展許可?您可以通過致電/me/permissions

1

查看授予您訪問令牌的權限。用戶必須先授權您獲取此信息。如果可能的話,我們會收到比我們已經收到的垃圾郵件多100倍的垃圾郵件。

Facebook tool可以幫助你。

5

你可以得到用戶的電子郵件這樣的: https://graph.facebook.com/v2.5/me?fields=id,name,email 更詳細的去here

相關問題