I'm interested in reading the posts in a private group that I'm a part of on Facebook.
Facebook's documentation shows that you can access a facebook group's feed with the following URL:
GET /v2.4/{group-id}/feed
However even after generating an access token with all permissions, this query always returns an empty array (and I know the group in question has posts in it):
{ data: [] }
One answer I have found suggests that this is because you need an access token for a user that is an administrator for the group.
Is this true? If so/otherwise, is there any way to access a facebook group's feed without admin access to the group?
Considering normal users have access to the group's feed, I would certainly expect there to be a way to do this.
The docs at https://developers.facebook.com/docs/graph-api/reference/v2.4/group/feed say:
Permissions
Any valid access token for a public group (i.e. the group's privacy setting is OPEN).
A user access token for a member of the group.
The user_managed_groups permission can be used to read the group content for a group in which the user is an admin. This permission also allows the app to post as the user in the group if the app is also granted the publish_actions permission. An app granted this permission can continue to use these capabilities even if the user stops being an admin of the group, although the user can remove the app from the group manually.
An app access token can read posts it published in app and game groups that belong to it.
Also, have a look at the changelog at https://developers.facebook.com/docs/apps/changelog#v2_4
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.
So, if you're using v2.4 and the group is private, and you're not an admin of the group, I think you cannot access the group's feed.
Related
The Facebook API documentation doesn't clearly state if it's possible to read a secret or closed group feed that the user is a member of, and I didn't succeed no matter the permissions asked. It works with owned groups though (and the user_managed_groups permission).
Permissions
Any valid access token for a public group (i.e. the group's privacy
setting is OPEN).
A user access token for a member of the group.
The user_managed_groups permission can be used to read the group content
for a group in which the user is an admin. This permission also allows
the app to post as the user in the group if the app is also granted
the publish_actions permission.
An app access token can read posts it published in app and game groups that belong to it.
Does anybody succeeded reading a secret or closed Facebook group feed with the API?
The user_managed_groups permission can be used to read the group content for a group in which the user is an admin
As long as the user is admin, it should work. Afaik it does not work if you are just a member.
We have user_status permissions for one of our apps. Graph API 2.2 is being used to get user statuses (https://graph.facebook.com/v2.2/me/feed?access_token=".$access_token). It returns empty data sets for SOME users (I get public profile info for these users but not status data). The app is live and the review team has granted permissions for user_status and user_likes. (user_status is passed to the scope). Is this a bug or User_status is dependent on some other permission? Why does it happen for some users and not all?
As #CBroe mentioned, you should inspect the Access Tokens with /me/permissions to see if they really contain the user_status permission.
I wonder why you're using /me/feed instead of /me/statuses. Maybe this has an effect as well.
See
https://developers.facebook.com/docs/facebook-login/permissions/v2.3#reference-user_status
https://developers.facebook.com/docs/graph-api/reference/user/statuses/
I want to get /{user-id}/feed from another user (user B) rather than "me" (user A), but the query returns an empty list.
I'm using the Graph API Explorer to make the queries, and I've got the Access Token with user_posts, user_status and read_stream permissions, but I can't get this information.
In this thread is said that:
Additionally the queried user needs to grant the app the read_stream permission.
In this other thread they said:
If the user is your app user authorized with read_stream permission, then you access the USER_ID/feed. It's because USER_ID/feed endpoint only available if user give permission read_stream to your app. App Access Token is not allow.
If the user is not your app user with read_stream, then you access the USER_ID/links instead. It's because no read_stream permission require to access this endpoint. App Access Token is not allow.
MY QUESTIONS:
Do I really need this other user (user B) to grant this permission to access his feed?
Where can I find official documentation saying so?
As /{user-id}/links seems to be accessible, are posts, statuses or tagged accessible too, or I just can access links without User B granting this permission?
Note:
Since the purpose is to use it in and iOS and Android App I can't use the read_stream permission, so I would use the user_posts which is supposed to be valid as they say in https://developers.facebook.com/docs/graph-api/reference/v2.3/user/feed
>
Of course, why would anyone want your App to access his newsfeed without his authorization? Keep in mind that not only the user would be able to access the feed of his friends, but the App too - which means, it would be easy for the App developer to get access.
Should be clear with number 1. Why would there even be a permission if you could just grab the feed from another user with it?
You canĀ“t get ANY data from a user without his authorization, for privacy reasons. Friend permissions are gone.
This works: https://developers.facebook.com/tools/explorer/145634995501895/?method=GET&path=me/groups
This doesn't: https://developers.facebook.com/tools/explorer/145634995501895/?method=GET&path=1234567890/groups
(where 1234567890 is someone who is not a friend, but is in or applying to a group I admin).
However, this works:
https://www.facebook.com/1234567890
and I can see their groups just fine.
QUESTION: Is there a way I can act-as-me or other permission to see someone's groups through an app?
This is likely a permissions/token thing - but I need to 'act-as-me' and see what I can see/have-rights-to.
END GOAL: I need to assist my rejecting of automated spammed join-requests. Easy to recognize who is fake, so I want to automate that. But, how can I have an app see what I see in FB (without screen scraping).
Thanks,
Even though you can see their groups publicly, you can't get their groups using the Graph API unless you have a valid Access Token from that user with user_groups permission.
The documentation for the User Groups clearly says that:
A user access token with user_groups permission is required to view the groups that person is a member of.
A user access token with friend_groups permission is required to view the groups that person's friends are members of.
You can find more details about Access tokens here.
I want to create and manage a group through the Facebook API. There are some older messages here (more than a year old) that say it can't be done -- is that still the case? Has anyone managed to do it?
I'm trying to mark groups' statuses as 'read' (so the unread count in the groups json via the Graph API goes down to 0). From what I can tell, to do anything with groups, you need a manage_groups permission, however using their OAuth for the Graph API, and trying to include the manage_groups permission returns an error suggestion the permission does not exist. Looks like a catch-22 for now.
Please consider subscribing to this facebook bug to help move it along faster:
http://developers.facebook.com/bugs/251651251563163
It looks like user_groups is the permission your looking for.
Any valid access token if the group is public (i.e. the group's privacy setting is OPEN)
"user_groups" permission to retrieve any groups that the session user is a member of.
The "user_managed_groups" permission can be used to read the group content for a group in which the user is an admin. This permission also allows the app to post as the user in the group if the app is also granted the "publish_actions" permission. An app granted this permission can continue to use these capabilities even if the user stops being an admin of the group, although the user can remove the app from the group manually.
https://developers.facebook.com/docs/graph-api/reference/v2.3/group