2

I am using FB Graph API to retrieve all friends info from the user:

$fb_friends = $facebook->api("/$fb_user_id/friends?fields=id,name,email,bio,gender,relationship_status,interested_in,birthday,hometown,location,languages,movies,music,books");

From the last few days, I am getting an error from FB when I run this api call - "unknown error occured".

I believe this is because there is too much data and FB is not able to return all the results. Any suggestions?

Ninja
  • 5,082
  • 6
  • 37
  • 59
  • 1
    I tried FQL and it works. However, FQL returns data in a different format from Graph API (eg. gender in graph api becomes sex in FQL and so on). I would prefer to make it work with graph api. The exact graph api query works in FB's graph explorer however when coded in my application it returns the error mentioned in the question title. – Ninja Aug 11 '13 at 18:24

1 Answers1

0

Quite old but still unanswered, and a lot of things changed since then. The /me/endpoint only returns friends who authorized your App with the user_friends permission. It is no longer possible to get access to all friends for privacy reasons. This thread explains all possibilities in detail: Facebook Graph Api v2.0+ - /me/friends returns empty, or only friends who also use my app

Btw, FQL is deprecated.

Community
  • 1
  • 1
andyrandy
  • 72,880
  • 8
  • 113
  • 130