I have a problem regarding fetching emails of friends when a person has signed up to my site using his facebook account.
I am trying to fetch the email id (email or contact_email or proxied email) from the User table using FQL..but I get all null values in it.
This is my Fql query-
/fql?q=SELECT+uid+,+ name+,+ pic_square+,+affiliations+,+birthday_date+,+sex+,+relationship_status+,+current_location+,+education_history+,+work_history+,+contact_email+ FROM+ user+ WHERE+(sex='female')+AND+uid+ IN +(SELECT+ uid2+ FROM +friend+ WHERE+ uid1=me())
Now when I am not able to fetch the email ids ,I am not able to send invitations to them automatically .
Give me some suggestions
PS I don't want to send personal messages or post on the facebook walls.
I don't think that you can do that.
If you look at the official documentation for the permissions: http://developers.facebook.com/docs/reference/api/permissions/ and look for the "email" permission which you need the user to grant you in order to get his email, next to it in the "Friends permission" column you'll see "N/A".
That should tell you that you can not get the e-mail address of the friends, and that's a good thing that facebook are not providing.
EDIT
You can also check out this thread: Facebook friends email FQL
Related
Good Evening, i'm just asking how to get a user's friends emails using face book API or something else, the scenario i want to use this feature in goes as follows, my application has a feature called 'import facebook friends' that will do the following:
- verifies that this user has a valid facebook account
- asks him for his facebook identifier(email)
- from his identifier get all his friends and get everyone's email
i don't know if there's any API that performs this functionality?
You can get almost all details about friends like their photos,interests, status updates but not email address.
From Facebook Email Permission Page : "Note: There is no way for apps to obtain email addresses for a user's friends."
To get a user's email address, you need the user_email permission. However, there is no equivalent friends_email permission to get Friends' email addresses as Facebook doesn't allow applications to get these.
Instead, you the Facebook User ID to link friends together. That is the correct way to do things, since the email address can change anyway.
I am new to iphone.my question is How to get all email id's of friends which are in friendsList from facebook while using Graph API in iPhone? I am able to get all the pictures,name,first name and last name of the friends which are in friends list except the email id's how can we do this If any body know this please help me.IF any body provide some code for this it will be helpful for me....
You can't, e-mail addresses aren't available via API for friends due to privacy risks.
See the facebook Permissions Reference.
It is simply not possible to get the email addresses of Facebook users other than the user of your app (ie. the person who authorizes your app and for whom you get an access_token), not even Friends of the user. Even extended permissions won’t help here.
I am doing some research into the capacity of Facebook Connect. I have some questions on how a couple of bits of functionality.
Is it possible to fetch a list of all friends of a user?
The idea of this is that a user would log in using my site and then they could search through their friends and select one, and the site would get that friends users id and store it to the sites database.
Getting a photos from that user
After getting the friends user id, would it then be possible to get their photos? Or would the friend need to give the site permission to do that?
I am looking into a site where you can buy a greetings card for a friend, and i wanted to know whether my users would be able to login via facebook, pick a friend, get a photo and then at the time of their birthday it would send them a private message (which i think i know how to do) linking them back to my site where they could view the birthday card and their photo.
Thanks
To answer your questions:
Yes. Once you have an access token from the login process for a user, make a Graph API request to https://graph.facebook.com/me/friends. You can test this for yourself here: https://developers.facebook.com/tools/explorer?method=GET&path=me%2Ffriends
Yes. During the login process, you must request user_photos and friends_photos permissions after which you can use the access token for a Graph API request to https://graph.facebook.com/USERID/photos. This will only return those photos for a friend which the user is allowed to see for the current privacy settings.
I am using facebook graph api and I am able to get the email id of logged in user. I want to know that how can I retrieve any of my Friends email id using his/her id .
Is it possible or not ?
Thanks
No, you cannot retrieve emails nor phones of your friends through API. Facebook restricts this for security reasons.
I had used the 'friend.get' api method to get the friends id and from id i am trying to fetch the friends details can not get the friend contact detail in it. So please let me know if you have any solution for the same.
You cannot get a user's friends' contact info using the Facebook API (as of October 11, 2011).
The only contact info you can get is the user's email address, and you must explicitly request that permission in order to have access to it. You'll note in the page I just linked to that the "email" permission is only available for the user, not for the user's friends.
As far as other contact info, like phone numbers and home addresses, that is not currently available, even for an authenticated user. (See this SO question, where one answer references this Facebook blog post, which describes how Facebook added (on January 14, 2011) two new permissions, "user_address" and "user_mobile_phone", but the previous link to the Facebook permissions page makes it clear that those permissions are no longer available. And even if they were still available, they were only meant for an authenticated user, not for a user's friends.)
It's only possible to view public information of a user's friends and any other user for that matter. You must get each individual user to accept a permission request from your application - this will then give you permission to extra information.
You haven't specified which contact information you're wanting, but with any permissions granted you will be unable to request the phone number, you can however get the email address of the current user by requesting the 'email' permission documented here. You'll notice on on the documentation, that in the Friend's Permission column for email says 'N/A' (thus, you can't get a user's friends email addresses).
Another thing to notice is that it's not even possible to retrieve your own phone number using the Graph API.