Is it possible to get a list of all groups I am a member of with the graph api? - facebook

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.

Related

Facebook Group API, members can't retrieve data

I have created an app in Javascript to allow members of a facebook group (closed) to get event information. I have gotten the app approved by facebook and added it to the group, however only admins of the group are able to retrieve the required data. Regular members as well as moderators are unable to retrieve the events.
Is there a way of doing this that I just haven't found yet? Or is it not possible at all?

How to get group-id in facebook Graph API

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.

How to get a list of facebook groups for a user using graph api v.2.4?

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.

Facebook graph API V2.0 - how to get group context? (memebers who are my friends)

Facebook major API change sucks but we have to deal with it. The page endpoint got a new "context" field which returns the number of friends who like this page, and the identity of the friends who also installed my app.
For example:
/v2.0/579302565453830?pretty=1&fields=context.fields(mutual_friends.limit(1000))
This is possible according to the new documentation:
https://developers.facebook.com/docs/facebook-login/social-context/v2.0
I can also get the members of a group, for instance:
/v2.0/573611446041812/members
How can I mix it and get only the members (or at least number of members) that are my friends?
/me/friends returns only friends that use my app so this is not an option.
As /v2.0/me/friends returns only app-using friends, its only possible to surface to a user the subset of a group's members, who are friends of the user, where those friends also use the app.
There is currently no friends_who_are_members (or similar) context edge on the Group node.
the only way you know if someone is your friend is if that targeted someone is also using your app and granted the necessary permission.
That said, if person A is your friend and A is using your app, 'A' will come up in /me/friends and isn't the answer to your question just the overlap of the two sets?
(/v2.0/blahblah/members) ^ (/me/friends)
?
It turns out that now the /me/friends doesn't return the list of all of my friends, there's no possible way to calculate my friends out of the members of a group.
I opened a bug in Facebook, hopefully the'll fix this issue.
https://developers.facebook.com/bugs/806713822672235/

Get Facebook user work

I'm trying to write some application that scan user's group posts. When I read the group feed posts using the API I’m interested to get some information on the one who posted this post ('from' field). The graph API today gives only the id and the name of this person. I'm interested also in his work place. I tried taking the user id and to access the / resource and to get his work field , but this field is not returned. When I’m looking on the same user profile in Facebook I see his work place is public, even I’m not connected with him.
Anything I can do to get this user work with the existing Facebook API?
Normally, if the work history info is not public, you'll need the "user_work_history" permission (see https://developers.facebook.com/docs/facebook-login/permissions#reference-extended-profile).
If it's public, you can try calling the
/{USER_ID}?fields=id,work