Facebook error: "(#100) Tried accessing nonexisting field (user_friends) on node type (User)"

E-A picture E-A · Sep 1, 2016 · Viewed 49.6k times · Source

I'm using MVC4 and try to integrate facebook-login. I've check the facebook scope list and it appears I use it correctly. Except the error when I try to get user_friends

Here is the url I try to get:

https://graph.facebook.com/me?fields=user_friends,email&access_token=<mytoken>

I get this error:

"{\"error\":{\"message\":\"(#100) Tried accessing nonexisting field (user_friends) on node type (User)\",\"type\":\"OAuthException\",\"code\":100,\"fbtrace_id\":\"Ahhh3PoddnL\"}}"

If you must know, my app is now Public, can get email and basic info (the permissions was asked and I approved)

When I use as below everything is fine:

https://graph.facebook.com/me?fields=email&access_token=<mytoken>

Answer

CBroe picture CBroe · Sep 1, 2016

user_friends is the name of the permission you need to request from the user, before you can access their friends.

It is not the name of the endpoint that you request the data from – that is /me/friends, see https://developers.facebook.com/docs/graph-api/reference/user/friends