페이스 북에서 폐쇄 된 그룹 소식을 가져올 수 없습니다. 나는 그 그룹의 회원이지만 그래프 api에서 내 액세스 토큰을 통해 액세스 할 수 없습니다. 하지만 내 액세스 토큰 을 사용하여 공개 그룹에서 모든 데이터를 가져올 수 있습니다.Facebook 그래프 API를 사용하여 닫기 그룹에서 데이터를 가져올 수 없습니다.
나는이 URL을 사용하고 있습니다 : [https://graph.facebook.com/my-group-id/feed?access_token=my-access-token]
내 코드 :
<?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;
}
}
}
?>
수정. 그게 API가 작동하는 방법입니다 – WizKid
하지만 왜 내가 폐쇄 그룹의 회원이라면 그 그룹의 게시물을 볼 수 있습니다 그럼 내가 왜 API를 통해 그래프에 액세스 할 수 있습니까? –
apbook에서 할 수없는 많은 일들이 facebook.com에서 할 수 있습니다 – WizKid