我想從Facebook獲得共同朋友,但它給了我錯誤的結果。共同的朋友總數計數這我得到的是正確的,但是當數據被用戶不來從facebook獲取錯誤的共同朋友計數
請求
https://graph.facebook.com/v2.8/1744744292507346?fields=context.fields(mutual_friends{name,picture.type(large)})&access_token=access_token
響應
{
"context": {
"mutual_friends": {
"data": [
{
"name": "Gaurav Varshney",
"picture": {
"data": {
"is_silhouette": false,
"url": "https://scontent.xx.fbcdn.net/v/t1.0-1/p200x200/15541198_1872071033026134_3669335060573505093_n.jpg?oh=d4a95ee6cdb8d401be06e8f10fbf6d50&oe=59B0C911"
}
},
"id": "1919297771636793"
}
],
"paging": {
"cursors": {
"before": "MTkxOTI5Nzc3MTYzNjc5MwZDZD",
"after": "MTkxOTI5Nzc3MTYzNjc5MwZDZD"
}
},
"summary": {
"total_count": 2
}
},
"id": "dXNlcl9jb250ZAXh0OgGQHYKW1ALzRNZBAkUhMk2uDFtLZBBkzlasCZAq98zEqnPZBjqy7beHZBJZCVZB7STTw6yMnKC0w4qDA05ZBOGQ3RdRoPjfi1cbAmnChBQ1xLYpJuuKrIEZD"
},
"id": "1744744292507346"
}
我只獲得自TOTAL_COUNT 1個朋友正在顯示2.可以告訴我我在哪裏做錯了嗎?我怎樣才能使用分頁?
當嘗試打all_mutual_friends
https://graph.facebook.com/v2.8/1744744292507346?fields=context.fields(all_mutual_friends{name,picture.type(large)})&access_token=access_token
{
"error": {
"message": "(#10) To use all_mutual_friends on behalf of people who are not admins, developers and testers of your app, your use of this endpoint must be reviewed and approved by Facebook. To submit this feature for review please read our documentation on reviewable features: https://developers.facebook.com/docs/apps/review",
"type": "OAuthException",
"code": 10,
"fbtrace_id": "HF3ZO8U3eLW"
}
}
total_count是兩個用戶共同的朋友總數;但是隻有在數據結構中返回的朋友纔是同一個應用的用戶。 – CBroe
如果你想要那些不是你的應用的用戶的共同朋友,那麼你需要使用'all_mutual_friends'來代替。 – CBroe
它仍然不起作用 – user6551529