Home unable to fetch data from close group using Facebook graph api
Reply: 0

unable to fetch data from close group using Facebook graph api

user9248
1#
user9248 Published in September 19, 2018, 3:18 am

I am unable to fetch closed group posts from facebook. As I'm the member of that group but i cant access it via my access token in graph api. But I can fetch all the data from open groups with my access token in which i am a member.

I am using this url: [https://graph.facebook.com/my-group-id/feed?access_token=my-access-token]

My Code:

<?php
   $group = array(
    array('id'=>'xxxx','name'=>'zzzzz'),
    array('id'=>'xxx' , 'name'=>'yyyy'),
    );

  $access_token = 'my token';

  $n = count($group);
  $i = -1;

  while($n--){
        $i++;
        $add = 'https://graph.facebook.com/'.$group[$i]['id'].'/feed?fields=id,name,story,message,updated_time&access_token='.$access_token;
        $json = file_get_contents($add);
        $data = json_decode($json);
        if($json){
            foreach($data->data as $item){
              $post_id = $item->id;
              $name = $item->name;
              $date = $item->updated_time;
              $story = $item->story;
              $message = $item->message;
            }
        }
  }
?>
share|improve this question
  • Correct. That is how the API works – WizKid Oct 6 '16 at 2:39
  • But why if im a member of a closed group then i can see the posts of that group then why cant i access it via graph api? – PIYUSH JIIT Oct 6 '16 at 2:45
  • 1
    There are many things you can do on facebook.com that you can't do in the api – WizKid Oct 6 '16 at 3:23
  • is their another way to do the same? – PIYUSH JIIT Oct 6 '16 at 11:27
  • No there is not. – WizKid Oct 6 '16 at 18:05

1 Answer 1

active oldest votes
up vote 1 down vote accepted
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.303291 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO