How can I access email id's of my facebook friends - facebook-graph-api

I am using koala(ruby gem/Facebook Api).
I want to access email list of my Facebook friend's.
Contacts (mac app) can access my friend's email id and their mobile phone no's.
How can I do that???

I don't particularly program with the facebook api. I wouldn't think they would provide you with direct access to information not published. Most sights such as Google (gmail) and Yahoo provide email addresses for their users that is associated with their username.
Facebook does also. Just use their public.username#facebook.com, just as you would a person's username#yahoo.com or their username#gmail.com.

Try
fb_api = Koala::Facebook::API.new(access_token)
fb_api.api("me/friends?fields=email")
but not every user will have entered the email address

Related

Is there a way to retrieve twitter handle/id and facebook id from a valid email address?

Is there a way to retrieve twitter handle/id and facebook id from a valid email address?
Given a list of email addresses, can we find the twitter account ids and facebook ids associated with it?
No, there is no way to get the IDs with only the email address. You should not connect any account without letting the user authorize it anyway. People may not want their accounts to be auto-connected with their email.

Facebook Login and email verification

Has Facebook always verified the email addresses for their users?
I am building an app with Django (using python-social-auth) where I want people to be able to login with their Facebook account. As far as I understand, the email is always verified. Even in the case when the person who has signed up used his/her phone number. If they enter an email later on, this email will still be verified.
However, I am not sure this was the case earlier. Can we trust that all the emails have been verified by Facebook for all the accounts?
More recently, the short answer is: Yes, if you get email from Facebook, this is verified email.
Also, remember that users may not have it set (i.e. phone registration) and probably, if you want to handle them, you will need to extend your pipeline to verification.
(But that allows you to handle for example twitter)
Anyway, more info in twin topic: Is it possible to check if an email is confirmed on Facebook?
In case anyone finds this question again, as of 2021, Facebook's documentation says that the email obtained from Facebook needs to be verified.
"1. Ensure the Facebook Login email address is verified
If you use an email address as the unique credential which identifies each account, your app should verify that the email address associated with the person's Facebook account (and obtained during Facebook Login) is valid. You can do this by creating code in your app to send a verification email to the address obtained after Facebook Login."
Source: https://developers.facebook.com/docs/facebook-login/multiple-providers#postfb1

Facebook API - no email in response

Is it possible to register Facebook account without having email tied to that account? I am asking because in some responses (1 out of 10000) I don't get email (I have perms="email" in request to API)?
Anyone have experience with this problem? What response do you display to user in this case?
Actually it is possible, for the case user signed up via facebook mobile app on a phone, and registered using a phone number.
email permission isn't one that blocks user from logging in, once granted it can be removed manually by user and he can avoid granting it in the future interactions with your app/site.
At least Facebook's JavaScript SDK passing user identity even if user skip granting email permission.
It is not possible to register a facebook account without an email. If you have users connecting your application but you can't see their email address, they probably denied permission.
It's not possible to have a facebook account without email, but it's possible to have it with unconfirmed email, in which case it's not provided via API:
Facebook Email field return null (even if the “email” permission is set and accepted)

Get Facebook friends using email and password

I need to get the facebook friends email ids of a user providing his login email id and password. That is, if we enter the facebook login email id and password we need to get the friends from facebook. So far i was only able to get the examples which uses Api_Key and Api_Secret. Even the Graph api is using Access Token. Is there any way to access the friends using email id and password? Please help.
This is against Facebook's Terms of Service. Specifically policy I.2:
You must not include functionality that proxies, requests or collects
Facebook usernames or passwords.
Also, you would be required to use the Facebook API which does not provide access to friends email addresses.
You'll need to ask your users to authenticate using the Facebook API. You shouldn't be collecting email and passwords on behalf of users. However, if you ask for offline access, then when you do this, you can access the data any time.
Facebook uses oAuth, so you and your application will never see the password of the user that you are getting permission for. oAuth (used by Twitter and Google as well) requires a bit of a handshake to get authenticated, but once you do, you can get permission from the user to do whatever you want, as long as they accept.
Check out https://developers.facebook.com/docs/guides/web/#login for more on how Facebook does authentication.

How to retrieve email addresses from my gmail account?

I am writing an "Invite Users" feature for my website.
I wanted the user to enter his gmail credentials or facebook credentials, and I wanted to send emails to the friends he chooses from.
Although I found out that you cannot send privates messages to your friends on FB via the API.
How can I accomplish the same using google / gmail ?
You should use the Google Contacts API along with OAuth. Accepting the user's GMail ID and password on your own site is never a good idea. http://code.google.com/apis/contacts/