Finding mutual friends on facebook

后端 未结 5 1467
执笔经年
执笔经年 2021-01-21 11:15

I want to find out mutual friends between two random users using the facebook Graph API v2.2.

I read through the documentation https://developers.facebook.com/docs/graph

5条回答
  •  余生分开走
    2021-01-21 11:16

    It is working for 2 users who are not friends.

    Here is a working example for facebook mutual friend API:

    curl -G -d "access_token=" -d "appsecret_proof=" 'https://graph.facebook.com/v2.5/{user-id}?fields=context.fields(mutual_friends)'
    

    The App secret proof is sha256 of user access token with app secret as the key.

    Remember both user should be using your App. The response will have users who are also using your app and given friend list permission.

    If you want to find specific info about the mutual friends try this:

    curl -G -d "access_token=" -d "appsecret_proof=" 'https://graph.facebook.com/v2.5/{user-id}?fields=context.fields(mutual_friends.fields(id,name,picture.type(large)))'
    

    This will return id, Name and current profile image link for all mutual friends. You don't need photos permission for this picture.

提交回复
热议问题