3

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.

Luke
  • 22,826
  • 31
  • 110
  • 193

2 Answers2

2

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.)

Community
  • 1
  • 1
1

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.

Luke
  • 22,826
  • 31
  • 110
  • 193