简体   繁体   中英

Facebook API - All Mutual Friends returning error

Trying to get my head around it but getting the same error. I have created 3 test users(user1,user2,user3) and each have added each other as friends.

Now I want to test the facebook API for all mutual friends by sending the below data :-

https://graph.facebook.com/v2.8/ [user2_userID] /all_mutual_friends?access_token= [User1_access_token] &appsecret_proof= [app_secret_proof_created_by_hashing_token_and_app_secret]

This is to get the mutual friends between user1 and user2 but I get the below error :-

{
  "error": {
    "message": "(#100) Tried accessing nonexisting field (all_mutual_friends) on node type (User)",
    "type": "OAuthException",
    "code": 100,
    "fbtrace_id": "AlCoK/9o/6h"
  }
}

I even tried with actual users thinking the test users might have some issues but I get the same error. Can someone tell me what exactly wrong am I doing here? The document says the same. https://developers.facebook.com/docs/graph-api/reference/user-context/all_mutual_friends

Thanks in advance.

for mutual_friends

{user-id}?fields=context.fields(mutual_friends)

for all_mutual_friends

{user-id}?fields=context.fields(all_mutual_friends.limit(100))

Permissions

  • A valid user access token with user_friends permission is required to view the mutual friends of other friends using the app.
  • The user in the request and the session user must both have granted user_friends permission to the app.
  • The ID will be returned for a mutual friend only if the given user has installed your app and granted the user_friends permission
  • If you want to call this endpoint on behalf two app-users who are not friends, then you must provide the appsecret_proof parameter along with the user access token when making the request. This means you must call this endpoint from your server.
  • Usage of the this field requires review by Facebook before it can be used by in production by non-developers of your app.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM