Fetching Friend contact details from the user's Facebook account? - facebook

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.

Related

How to get a facebook user's friends emails

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.

Graph API won't return friends' religions

I have a screen where users can select Facebook friends. After submitting the form, I'm requesting a profile object from Facebook with specific fields (e.g.: https://graph.facebook.com/some_id?fields=id,name,religion&access_token=xxx).
When I request my own profile data with the religion field in the request, I'm seeing the value properly included with the result. When I request my friends' profile data, the response is not including their religion even though I can see it when viewing their profile page directly.
I have made sure that I am requesting both user_religion_politics and friends_religion_politics permissions prior to making this call (and am using the updated access token). What's going on?
After creating two test user accounts, it appears that one of two things must be true in order to access a friend's religion via the Graph API:
The friend must make their religion info "Public". Setting it to "Friends of Friends" for example is not enough to let it be retrieved by the API for some reason, regardless of our friendship.
The friend must authorize the app's friends_religion_politics permission. By authorizing that permission on my own account, I am not telling Facebook that I want to allow access to my friend's religion info. Instead, I am telling Facebook that I want to allow my own religion info for other friends who are requesting it via Graph API.
The second point is a very important distinction, and I wish it were spelled out in the documentation as such. The permission is essentially worthless for my needs as is stands now, unfortunately.

How to get all email id's of friends which are in friendsList from facebook

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.

Getting friend user id, and their photos

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.

Is it possible now to get through Facebook API user's address?

I found this Facebook API - How to get user's address, phone #? ,but this was last year. I would like to know if now is there any way I can get the user address.
Duplicate question of Facebook API - How to get user's address, phone #?. The answer is still the same, that the user's address and phone number is not available via the api. At one point Facebook posted a blog post about how to get address/phone information and did temporarily enable access to this info, but I'm pretty sure they have since revoked that and said they would review that possibility later.