简体   繁体   English

Facebook API-所有共同好友返回错误

[英]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. 我已经创建了3个测试用户(user1,user2,user3),并且每个人都彼此添加为朋友。

Now I want to test the facebook API for all mutual friends by sending the below data :- 现在,我想通过发送以下数据来测试所有共同朋友的facebook API:

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] https://graph.facebook.com/v2.8/ [user2_userID] / all_mutual_friends?access_token = [User1_access_token] &appsecret_proof = [app_secret_proof_proofedcreated_by_hashing_token_and_app_secret]

This is to get the mutual friends between user1 and user2 but I get the below error :- 这是为了获得user1和user2之间的共同朋友,但我得到以下错误:-

{
  "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 https://developers.facebook.com/docs/graph-api/reference/user-context/all_mutual_friends

Thanks in advance. 提前致谢。

for mutual_friends 对于mutual_friends

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

for all_mutual_friends 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. 要使用该应用查看其他朋友的共同朋友,需要具有user_friends权限的有效用户访问令牌。
  • The user in the request and the session user must both have granted user_friends permission to the app. 请求中的用户和会话用户必须都已向该应用授予user_friends权限。
  • The ID will be returned for a mutual friend only if the given user has installed your app and granted the user_friends permission 仅当给定用户已安装您的应用并授予user_friends权限时,才会为共同的朋友返回ID。
  • 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. 如果要代表两个不是朋友的应用程序用户调用此终结点,则在发出请求时必须提供appsecret_proof参数以及用户访问令牌。 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. 要使用此字段,需要Facebook进行审查,然后才能由您的应用的非开发人员在生产中使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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