12

I know it's possible to get an rss feed or whatever for wall posts of groups. However, every time I try it with a closed group that I belong to, it doesn't work. Is this possible if you aren't the admin or owner of a group but just a member? Here are the steps that I've taken so far.

  1. Create an application on http://developers.facebook.com/setup/
  2. When you are done, you will see App Name, App URL, App ID, and App Secret. Copy down these data.
  3. access https://graph.facebook.com/oauth/authorize?client_id={CLIENT_ID}&scope=offline_access&redirect_url={URL}.

Replace {CLIENT_ID} with your App ID. Replace {URL} with your App URL.

  1. When you prompt “Request for Permission” page, click [ ALLOW ] button.
  2. You will be redirect to {URL}/?code={YOUR CODE}
  3. Copy down {YOUR CODE}
  4. Access https://graph.facebook.com/oauth/access_token?client_id={CLIENT_ID}&redirect_uri={URL}&client_secret={APPLICATION_SECRET}&code={YOUR_CODE}

Replace {CLIENT_ID} with your App ID Replace {URL} with your App URL Replace {APPLICATION_SECRET} with your App Secret Replace {YOUR_CODE} with your {YOUR CODE}

When you hit the url, you will get access token.

At this point I don't get an access token I get this.

{
"error": {
  "message": "This authorization code has expired.",
  "type": "OAuthException",
  "code": 100
}}

The problem is, I just created the auth code like 2 seconds prior. No way could it have expired. So I can't follow the rest of the steps below until I have that access token.

Copy your access token.

Now, access the following url with your access token.

http://graph.facebook.com/{YOUR GROUP ID}/feed?access_token={ACCESS TOKEN}

When you go to your group page, you url is something like /group.php?gid=xxxxxxxxx. In this case, gid is your group id.

ekad
  • 14,436
  • 26
  • 44
  • 46
user1888959
  • 329
  • 2
  • 11
  • Hi Owen. I am having that same problem you had. Can you please please help me? :) http://stackoverflow.com/questions/26955145/is-it-possible-to-get-facebook-feed-likes-and-comments-from-a-closed-group-that I'm very confused – Imnotapotato Nov 16 '14 at 10:45

2 Answers2

5

To answer your question, yes you can access the posts even if you are not admin/owner. If you can see all posts of a group, there should be no reason not to be able to access them with the api.

First, check if the access token is having 'user_groups' checked, otherwise you will not be able to access a closed groups. You can play with Graph Explorer yourself, till you get the needed results.

If you experience problems after you get the right access token, then check if the token is not expired.

VessoVit
  • 468
  • 5
  • 12
  • I can't find `user_groups` option in the list? – TomSawyer Jul 27 '16 at 11:02
  • 1
    Unfortunately this option is no longer available. :( for some reason fb removed it from the api. However, u can still access it if u choose API version 2.0 up to 2.3. – VessoVit Aug 04 '16 at 00:05
  • What are causes of using old API versions ? I thought theyre going to expire soon? :( – TomSawyer Aug 04 '16 at 08:58
  • Indeed they will expire, but probably not rly soon. If i've to guess, probably with version 3 and those major updates did not happen since graph. – VessoVit Aug 04 '16 at 09:15
  • 2
    Looks like there's no way to get feed data from closed groups even if you're a member of the group after 6/12 2017. I had an app that worked fine but now it's broken. So facebook expects you to be the admin of a group to access the feed programmatically even if you're a member in it. Shame. See: https://stackoverflow.com/a/44418809 – Gaurav Oct 29 '17 at 08:24
  • @Gaurav's right, user_groups is now deprecated and I can't seem to find a way to access those closed groups, if I'm not the admin. – Alexandre Rozier Jan 30 '18 at 21:37
1

You should switch to v2.3 because from version 2.4 facebook restricted with closed groups and also user's new feed.

Try with v2.3 and check on read_stream on get token access. Note that only by switching to v2.3, we can see the read-stream option

https://tngotran.wordpress.com/2017/02/01/facebook-api-explain-example-and-real-project-tutorial/

tngotran
  • 361
  • 2
  • 7