YouTube Analytics API: 404 Not Found Exception while sending query

30 views
Skip to first unread message

Inessa M

unread,
Jan 14, 2020, 7:45:26 PM1/14/20
to Google APIs Explorer Users Forum
Hi all,

I try to send targeted query via YouTube Analytics API but I receive "[Google_Service_Exception (404)] Not Found" exception. I'm using googleapis/google-api-php-client v2.4.0 and PHP v7.1.19. Here is my code:

$this->client = new Google_Client();
$this
->client->setAuthConfig($credentials);
$this
->client->addScope(Google_Service_YouTube::YOUTUBE);
$this
->client->addScope(Google_Service_YouTubeAnalytics::YT_ANALYTICS_MONETARY_READONLY);
$this
->client->setAccessType('offline');
$this
->client->setIncludeGrantedScopes(true);


$service
= new \Google_Service_YouTubeAnalytics($this->client);


$report
= $service->reports->query('channel==' . $channelId, '2020-01-11', '2020-01-13',
'views,likes,dislikes', ['dimensions' => 'day']);


Thanks for help in advance!

Inessa M

unread,
Jan 15, 2020, 5:42:25 PM1/15/20
to Google APIs Explorer Users Forum
The problem was that I used an old version (v0.41) of googleapis/google-api-php-client-services. After updating to the latest one it works just fine.

среда, 15 января 2020 г., 10:45:26 UTC+10 пользователь Inessa M написал:
Reply all
Reply to author
Forward
0 new messages