简体   繁体   English

使用 Graph API ( v 7.0 ) 访问私有 facebook 组的帖子

[英]Access private facebook group's posts using Graph API ( v 7.0 )

I am trying to get private groups posts by using graph api v7.0 by unfortunately i did not get posts returned an error Graph returned an error: (#803) Cannot query users by their username (SAAME)我正在尝试使用图表 api v7.0 获取私人群组帖子,不幸的是我没有收到帖子返回错误图表返回错误:(#803)无法通过用户名查询用户(SAAME)

    try {
    // Returns a `Facebook\FacebookResponse` object
    $response = $fb->get(
        '/SAAME/feed',
        '{access-token}'
    );
} catch(Facebook\Exceptions\FacebookResponseException $e) {
    echo 'Graph returned an error: ' . $e->getMessage();
    exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
    echo 'Facebook SDK returned an error: ' . $e->getMessage();
    exit;
}
//$graphNode = $response->getGraphNode();

$data = (array) $response;

var_dump ($data);

https://developers.facebook.com/docs/graph-api/reference/v7.0/group/feed https://developers.facebook.com/docs/graph-api/reference/v7.0/group/feed

Check out the requirements, especially the bold ones:查看要求,尤其是粗体要求:

  • Your app must be approved for the Groups API feature.您的应用程序必须获得组 API 功能的批准。
  • The app must be installed on the Group.该应用程序必须安装在组上。 (can only be done as group admin) (只能以组管理员身份完成)
  • A User access token.用户访问令牌。 (i assume any user token of a group member is ok) (我假设组成员的任何用户令牌都可以)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM