tags:

views:

138

answers:

1

Hi all,

I am building a small facebook app. In my app I am trying to get a list of my friend's friends. When I perfrom this I receive an error from facebook that I cannot select information about people that are not me (I was trying to retrieve my friend's friends )

Here is an example of what I mean:

User A - Uses the application User B - Friend of user A and also uses the application

I want User A to be able to see a list of all of user's B friend's who are using the application as well.

Is there any way to get arround that? How can I do this?

+2  A: 

The way to get a list of friends for someone is by using the friends.get API method. However, webdreamer is correct in that you can't just pick any Facebook ID you want and start pulling out friend information for that person. The person you query about has to have authorized your application... otherwise any app developer could find out anything about anyone on Facebook, which would be a privacy nightmare.

It's tough to tell exactly what you want to do though, as your comments say you just want the friends of a user, and your original question says you want the friends of the friends. The first is possible... the second is not.

For the first, all you need to do is have someone add/authorize your app. After that, friends.get will work fine with that user's session key, which will be provided to your application, and you can get a list of their friends.

zombat

related questions