针对多个用户的请求,YouTube Analytics响应403

时间:2014-06-27 12:53:32

标签: youtube-analytics

这是我的客户端设置

$this->_client = new Google_Client();
$this->_client->setClientId( $_config['OAUTH2_CLIENT_ID'] );
$this->_client->setClientSecret( $_config['OAUTH2_CLIENT_SECRET'] );
$this->_client->setScopes( array( 'https://www.googleapis.com/auth/youtube', 'https://www.googleapis.com/auth/yt-analytics.readonly' ) );
$this->_client->setAccessType( 'offline' );
$this->_client->setRedirectUri( filter_var( $_config['OAUTH2_REDIRECT_URI'] ),  FILTER_SANITIZE_URL );


$this->_analytics = new YoutubeAnalyticsClient( $this, $this->_client );

我为在系统中签名的每个用户

进行此操作
$this->_analytics->setChannelId( $_usr_yt_channel_id );
$this->_analytics->setStartDate( $_period[0] );
$this->_analytics->setEndDate( $_period[1] );

我没有得到第一次登录用户

的响应
2014-06-27 12:39:48 Exception: Error calling GET https://www.googleapis.com/youtube/analytics/v1/reports?ids=channel%3D%3DUCoZb0E-9pd6O7BPhd-tU2NA&start-date=2014-06-15&end-date=2014-06-25&metrics=views&dimensions=country&filters=video%3D%3DftqqLcm5U1U&sort=-views&quotaUser=UCoZb0E-9pd6O7BPhd-tU2NA: (403) Forbidden
2014-06-27 12:39:51 Exception: Error calling GET https://www.googleapis.com/youtube/analytics/v1/reports?ids=channel%3D%3DUCoZb0E-9pd6O7BPhd-tU2NA&start-date=2014-06-15&end-date=2014-06-25&metrics=viewerPercentage&dimensions=ageGroup&filters=video%3D%3DftqqLcm5U1U&sort=ageGroup&quotaUser=UCoZb0E-9pd6O7BPhd-tU2NA: (403) Forbidden

删除“quotaUser”不会改变任何内容。

0 个答案:

没有答案