我正在使用下面的代码,但它没有提供任何输出。我想得到所有的页面ID&我拥有的Facebook页面的给定页面帖子ID下的所有评论。在我在下面的代码中添加App ID,密码ID,访问令牌,页面ID后,我没有得到任何输出。
<?php
include 'vendor/autoload.php';
use FacebookAds\Object\Values\InsightsLevels;
use FacebookAds\Api;
use FacebookAds\Object\AdUser;
use Facebook\FacebookRequestException;
use FacebookAds\Object\Values\InsightsPresets;
use Facebook\FacebookSession;
use Facebook\GraphUser;
$app_id = 'XX';
$app_secret = 'XXX';
$access_token = 'XXXX';
Api::init($app_id, $app_secret, $access_token);
$api = Api::instance();
use FacebookAds\Object\AdAccount;
use FacebookAds\Object\Fields\AdSetFields;
use FacebookAds\Object\Fields\CampaignFields;
use FacebookAds\Object\Fields\InsightsFields;
use Facebook\FacebookRequest;
use FacebookAds\Object\campaign;
use FacebookAds\Object\Fields\AdAccountFields;
$request = new FacebookRequest(
$session,
'GET',
'/Page ID/feed',
array(
'fields' => 'object_id,comments'
)
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
/* handle the result */
echo print_r( $graphObject, 1 );
}