My goal is to get the members of a facebook group. Looks like I can do it but I need to know the group-id
How to get that? For example - what would be the group-id for this group and how to find it: https://www.facebook.com/groups/pythonears/?
Authorize with the user_managed_groups permission, use /me/groups to get all groups you manage and you will have the IDs. The members of groups you don´t manage should be none of your business anyway.
If you don´t manage the group, you can use the Search API, this would be the API call: /search?type=group&q=pythonears
Be aware that you may also get other groups, if they have the search string in their name.
Those are the only options you have. Everything else would be scraping, which is not allowed on Facebook - that´s how platforms like lookup-id.com do it.
Related
As the title asks is it possible to get a list of all groups I am a member of with the graph api? I can't find anything in the docs but it seems odd that this endpoint would not be made available.
In my case I'm developing a tool that alerts the user when a post containing specific keywords is posted to a group they are a member of. The flow goes like this:
User accepts app permissions
All groups are compiled into a list
User selects the groups they want to monitor for specific posts
I use their token to periodically check their selected groups for posts that match the keyword/s. If a match is found an email/sms is sent out to the user alerting them of the matched post.
Is this possible?
You can only get a list of groups you manage, there is no way to get a list of groups you are just a member of anymore. The user_groups permission got removed, there is only user_managed_groups now.
Scraping is not allowed on Facebook, btw. If it´s not possible with the Graph API, it´s most likely not allowed.
I am trying to get a list of posts in a particular group on facebook that is closed, also I am not the admin, just a member in this group. When I am trying to access the group's posts via graph explorer (I checked all the permissions) I am getting an empty list returned.
What is facebook's reason for not allowing this access? If I am a member of this group I have access to this information anyway via browser/scraping...
Your thoughts and suggestions are appreciated.
What is facebook's reason for not allowing this access? If I am a member of this group I have access to this information anyway via browser
That would be only you being able to see the posts then, fine. Two parties involved - you, and the other group members; everyone aware of who will be able to read the posts, all good.
But with an app, a third party gets involved - the app developer. And they could theoretically do anything with that data, that the app reads from the API on your behalf. (Sure, the app developer might be you in this special case here - but that is not the normal use case.)
And in a closed group people might discuss topics that are a little more sensitive than the current weather; think f.e. health problems or something like that. For sure not the stuff you’d want exposed to any third parties.
And therefor, the decision whether an app should be able to read the group’s feed posts, has been placed in the hands of the group admin(s).
If you would like to access the data use api version 2.3, the only downside is that it will be deprecated.
Now graph api has version 2.4. I want to get a list of facebook groups for a user using graph api. I check user_managed_groups in user data permission already. But it return null.
How do I do?
You probably don´t manage any groups, that´s why you don´t get anything with /me/groups and the user_managed_groups permission. You can only get a list of groups you manage. That´s all i can say, for more information you would need to extend your question with some details and example code.
I think you're trying to get a list of all groups someone is a member of using Graph 2.4?
In version 2.4 this feature is deprecated unless you are an administrator of the group in question. You will just get an empty array returned - which is probably why you're seeing null.
Basically the functionality is no longer there for what you want.
Ive looked through the API and dont see it, but I thought Id ask anyway. Can I add users to a group through the API?
It is not possible to add users to a group via the API.
the question is in the title.
I have been assigned to find out if the following is possible:
I create a group on Facebook. Selected people become members.
On a external website, I want to display all group members with their basic info - picture, name, link to public profile.
I have skimmed the Facebook Dev pages, and so far it seems to me that this is not possible simply with Social Plugins. Do I have to write some sort of App for Facebook? It came to my mind, that there should probably some permission from the group members to display them, is that right? But this probably does only work with an App, not a group. So do I have to create an App and use the Graph API to include the data on the website?
Yes, you will have to create an app. The facepile plugin will show faces, but I do not believe you can target a group with it.
It should be a reasonably straightforward app to create: you will need the user_group permission and I believe that would be it.
If the group is public, just access it by going to https://graph.facebook.com/groupid and to get the members, access https://graph.facebook.com/groupid/members
If the group is private or closed, you will need to create an app so that you can get an access token. Look at their authorization documentation on that (you will probably need to create a temporary dummy website to do the redirects to Facebook and record the token then grant you). You will probably need offline_access to run the call over and over.
With that access token, access the groups api using the url format posted above and with the access_token appended as a query string parameter.