I need to get basic user data from Facebook using FB.api('/<some_id>/'). This works well, but is slow, since I need to ask for every id separately and make several calls to facebook. Is there any way to gather all ids and ask for them in single request and get an array?
EDIT
I am not asking for user friends. I am actually trying to gather friends’ friends of a user and that’s something Facebook doesn’t provide, that’s why I am using graph.facebook.com/<id>/ rather than graph.facebook.com/me/friends. I don’t want friends, I’d like to do something like this: graph.facebook.com/<id1>,<id2>,<id3>,../
How about using
FQL:From the Facebook examples:
Then edit for whatever collection of ids you wish to use.
The above approach remains valid (as a reasonable generic example) – however, to clarify:
You would previously have used users.getInfo to do what you are asking, as this allows you to pass a list of UIDS. Unfortunately this is being deprecated. However, all this query actually does is wrap an FQL query.
If you then apply the standard FQL ‘in’ syntax you can achieve this:
However facebook actively prevents you from doing this with the error:
Your other option is to get all of the ids and do an FQL query of the form: