How to get the list of facebook groups using graph api
Asked Answered
C

4

8

I want the list of groups in which I'm member. In the Graph Api Explorer I did not find any permission like user_groups. I select all the "User Data Permissions" and "Extended Permissions" but it did not work.

In graph api explorer I am using this command GET->/v2.4/me/groups. and i get empty JSON data Like this.

{
  "data":[
  ]
}

And if I use the old graph api version 2.2 Like GET->/v2.2/me/groups then I get the groups only in which I am admin not all the groups.

If anyone have this experience and also have any solution please help me to solve my problem.

Caduceus answered 9/9, 2015 at 7:0 Comment(1)
Did you find a way around to get the list of all groups that you/users are a member of?Uxoricide
S
7

Short answer: user_groups is deprecated with v2.4, see

the user_groups permission has been deprecated. Developers may continue to use the user_managed_groups permission to access the groups a person is the administrator of. This information is still accessed via the /v2.4/{user_id}/groups edge which is still available in v2.4.

Skinhead answered 9/9, 2015 at 7:4 Comment(9)
but when i try to access via '/v2.4/{user_id}/groups' edge. it give me blank JSON data.Caduceus
is there any way to access the list of user groups via facebook api's ?Caduceus
I'm talking about the Graph API, so I don't understand your second comment. It's gone, and it's all in the docs.Skinhead
Thanks for your reply Friend i got it. user_gorups permission is working great in Graph api v2.3.Caduceus
actually you need to change the api version first and then re-access the permissions by clicking on get token button then you will fine the user_gorups permission there.Caduceus
You can only change the Graph API version if your app supports it. If you'd create an app today, you wouldn't be able to use v2.3, just v2.4Skinhead
Thanks for this additional knowledge. i created my app one year ago and now i start developing it.Caduceus
Ok, that explains why it works... Have an additional look at developers.facebook.com/docs/apps/changelog to see how long v2.3 will live.Skinhead
i never read these type of information but now because of you i understand it's importance.Caduceus
Y
4

What are you looking for exactly?

  1. The list of all groups that you are a member of?
  2. The list of all groups that you admin?

I am not sure about A but at the time of writing this answer, Graph API v2.5 is the latest version and you can find the list of all the groups where you are the admin by using the admined_groups endpoint. You need the permission user_managed_groups in your Access Token, without the permission you will get empty data.

Here is a link to the endpoint

Yonit answered 13/10, 2015 at 15:53 Comment(1)
As of today (April 2019) you can retrieve all Groups you are admin of from the Facebook Graph API by adding the "admin_only" to your query string. Here is the link to the Facebook API documentation: https://developers.facebook.com/docs/graph-api/reference/user/groupsStinkpot
T
1

Update 27 Juli 2022

You must have permission called groups_access_member_info for get list group

Thyroiditis answered 27/7, 2022 at 5:7 Comment(0)
K
0

To obtain the list of Facebook groups, you can submit a request to the following endpoint:

https://graph.facebook.com/v5.0/{ID GROUP}?&access_token={ACCESS_TOKEN}
Kancler answered 3/2, 2020 at 18:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.