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

血红的双手。 提交于 2019-12-03 16:38:47

问题


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.


回答1:


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.




回答2:


You should switch to v2.3 because from version 2.4 facebook restrict with closed group and also user new feed.

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

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



来源:https://stackoverflow.com/questions/16816436/is-it-possible-to-get-a-facebook-feed-to-a-closed-group-that-i-belong-to-but-do

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!