facebook graph api - How to get friendlists of the not current session user? -
i read facebook api
https://developers.facebook.com/docs/reference/api/user/
i trying request friendlists using not current session follows:
1. access token via app
https://graph.facebook.com/oauth/access_token? client_id=your_app_id&client_secret=your_app_secret&grant_type=client_credentials
i surely obtained access token. shown below:
access_token=1234567890|-abcdefghijkl
2. request friendlists using access token.
https://graph.facebook.com/1023456789/friendlists?access_token=1234567890|-abcdefghijkl
but, following error message has been received.
{ "error": { "message": "a user access token required request resource.", "type": "oauthexception", "code": 102 } } id not current user session. know, if using current user session. can friends lists in without problem.
https://graph.facebook.com/me/friends?access_token=1234567890|-abcdefghijkl
my question can summarized follows:
how friends list using user id not current session? think must obtain friendlists permission when accesstoken. if right. how do that?
assuming access token got 1 where, user redirected fb login page , redirected application read along.
the documentation can bit confusing. this page states that:
when user logs app , request no additional permissions, app have access user's public profile , friend list.
without digging documentation permission list, 1 might think when read_friendlists added scope user's friend list available, won't be. this page indicated reading facebook user's friend list requires extended permission.
so need add read_friendlists 1 of scope. here's sample request:
https://www.facebook.com/dialog/oauth?type=user_agent &client_id=your_fb_appid &redirect_uri=your_domain &scope=read_friendlists
Comments
Post a Comment