2

My requirement is to fetch all the groups/ pages that a user has joined/ liked using facebook graph api. Do we need permission of the user to fetch them? I tried this:

https://graph.facebook.com/puzzell/groups?access_token=xxxxxxxxxxxxxxxxxxxx|lGI-q-ooUDPJBryegadsgrfgr5dr

But got only :

{
"data": [

]
}

Empty data. What Am i missing? Or is it even possible to fetch them? The access token is generated by the app created by me where puzzell is the user id who has nothing to do with my app.

Please ask if you need to know anything else. Thank you.

Prajwol Onta
  • 1,448
  • 5
  • 21
  • 48

1 Answers1

3

To read a Group, you need:

  1. any valid access_token if the group is public (i.e. the group's
    privacy setting is OPEN)
  2. user_groups permission for a user's non-public groups
  3. friends_groups permission for a user's friend's non-public groups
  4. Groups for Apps and Games require the use of an App access_token.

https://graph.facebook.com/me?fields=id,name,groups

You can read the pages that a User has liked by issuing an HTTP GET to /PROFILE_ID/likes with the user_likes or friends_likes permissions. For example:

https://graph.facebook.com/me/likes  
thomasbabuj
  • 3,779
  • 3
  • 24
  • 22
  • `https://graph.facebook.com/me?fields=id,name,groups` gives me `An active access token must be used to query information about the current user.` and im logged in facebook. – Prajwol Onta Feb 22 '13 at 04:48
  • the user need to authenticate your app to get group info related him. – thomasbabuj Feb 22 '13 at 04:51
  • i was trying to get groups of a whole lot of users by their IDs. But now i think its not possible without their authentication or is it?? – Prajwol Onta Feb 22 '13 at 04:56
  • Yes its not possible without their authentication. – thomasbabuj Feb 22 '13 at 05:00
  • thank you @thomasbabuj . thats all i need to know. accepting this answer since it gives answer to my question. – Prajwol Onta Feb 22 '13 at 05:23
  • This endpoint mentioned in this answer, only returns groups managed by the user not the groups he joined. Also you need user_managed_groups to get it. – gurung Sep 02 '17 at 06:43