Reputation: 812
I am trying to get the total friend count for an authorized user of our app:
GET /2.4/10107720201461/friends
where 10107720201461
is the user-id as referenced in /user/friends Graph API. I know that individual friends are only supposed to be shown if they have authorized by our app, and that is fine. I am only interested in the summary field for total_count. This works for the me
user and works for admins of the app, but doesn't work for other users. Despite the fact that user 10107720201461
has authorized our app, and has explicitly granted the user_friends permission scope and our app is live to the public and has been reviewed by Facebook for extended permissions. I have verified the user's access token using Facebook's Access Token Debugger tool.
The response received is:
{
"error": {
"message": "Unsupported operation",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "Gi4F64t6eaM"
}
}
Upvotes: 0
Views: 132
Reputation: 73984
You have to use the Access Token of the user with that ID, and it has to be valid. I assume you are using another Access Token. You should actually always use /me
. If you want to get data from another user, either store his (Extended) Access Token or cache his data.
Edit: It MAY work with another User Token only if both users are friends - and both users have user_friends
authorized.
Upvotes: 1