Google Search Console API - SearchAnalytics 500 错误
Google Search Console API - SearchAnalytics 500 error
我正在尝试使用 SearchAnalyticsQuery 从 Search Console Api 中获取一些数据。
首先我用PHP试过了:
$this->client->setAccessToken( \Session::get('access_token') );
$webmaster = new \Google_Service_Webmasters( $this->client );
$q = new \Google_Service_Webmasters_SearchAnalyticsQueryRequest();
$q->setStartDate('2015-01-01');
try {
$webmaster->searchanalytics->query('http://example.com', $q);
} catch(\Exception $e )
{
dd($e);
}
我有一个有效的令牌,它执行请求但总是 returns 以下内容:
Error calling POST https://www.googleapis.com/webmasters/v3/sites/example.com/searchAnalytics/query: (500) Backend Error
为了确保它不是由 PHP 代码引起的,我还使用 Google Api Explorer 进行了尝试。
此处结果相同:http://i.imgur.com/Qrm3VhS.png
我目前使用的是 https://github.com/google/google-api-php-client
的 dev-master 版本
一定是我做错了什么,我就是想不通。
您没有设置 endDate
(必需参数)- 请参阅 official documentation。
我正在尝试使用 SearchAnalyticsQuery 从 Search Console Api 中获取一些数据。
首先我用PHP试过了:
$this->client->setAccessToken( \Session::get('access_token') );
$webmaster = new \Google_Service_Webmasters( $this->client );
$q = new \Google_Service_Webmasters_SearchAnalyticsQueryRequest();
$q->setStartDate('2015-01-01');
try {
$webmaster->searchanalytics->query('http://example.com', $q);
} catch(\Exception $e )
{
dd($e);
}
我有一个有效的令牌,它执行请求但总是 returns 以下内容:
Error calling POST https://www.googleapis.com/webmasters/v3/sites/example.com/searchAnalytics/query: (500) Backend Error
为了确保它不是由 PHP 代码引起的,我还使用 Google Api Explorer 进行了尝试。
此处结果相同:http://i.imgur.com/Qrm3VhS.png
我目前使用的是 https://github.com/google/google-api-php-client
的 dev-master 版本一定是我做错了什么,我就是想不通。
您没有设置 endDate
(必需参数)- 请参阅 official documentation。