facebook insight(page-insights)HTTP状态码:200

时间:2017-06-30 05:08:36

标签: facebook facebook-graph-api facebook-php-sdk facebook-insights

使用此代码,但显示“HTTP状态200”我检查了Facebook文档,但问题没有解决,请帮助我

$requestPageInsights = $fb->request('GET', '/Page-ID/insights/post_storytellers?, $accessToken');

//发出批量请求

$batch = ['page-insights' => $requestPageInsights];

try {
 $responses = $fb->sendBatchRequest($batch);
} catch(Facebook\Exceptions\FacebookResponseException $e) {

//当Graph返回错误时

 echo 'Graph returned an error: ' . $e->getMessage();
 exit;
 } catch(Facebook\Exceptions\FacebookSDKException $e) {

//验证失败或其他本地问题

echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}


foreach ($responses as $key => $response) {
if ($response->isError()) {
 $e = $response->getThrownException();
 echo '<p>Error! Facebook SDK Said: ' . $e->getMessage() . "\n\n";
 echo '<p>Graph Said: ' . "\n\n";
 var_dump($e->getResponse());
 } else {
  echo "<p>(" . $key . ") HTTP status code: " . $response->getHttpStatusCode() . "<br />\n";
   echo "Response: " . $response->getBody() . "</p>\n\n";
   echo "<hr />\n\n";
  }
}

和输出是: (页面见解)HTTP状态代码:200 回复:{“data”:[],“paging”:{“previous”:“https://graph.facebook.com/v2.9/1**********1/insights?< / p>

我认为这是一个分页问题,​​但不知道如何解决它。

0 个答案:

没有答案