Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to get a facebook feed to a closed group that I belong to but do not own?

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.

like image 482
user1888959 Avatar asked May 29 '13 14:05

user1888959


2 Answers

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.

like image 94
VessoVit Avatar answered Nov 09 '22 13:11

VessoVit


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/

like image 40
tngotran Avatar answered Nov 09 '22 12:11

tngotran