Using google SDK I am getting the youtube channel id access_token successfully, but I want more details from youtube channel, for that, am passing the access token, developer key via Curl but am getting the following error
linslin\yii2\curl\Curl Object
(
[response] => {
"error": {
"code": 400,
"message": "Required",
"errors": [
{
"message": "Required",
"domain": "global",
"reason": "required"
}
]
}
}
Here below my controller Action Code.,
$curl = new curl\Curl();
$response =
$curl->setGetParams([
'metrics' => 'views,averageViewPercentage,comments,likes,dislikes',
'key' => $developer_key,
'channel' => 'MINE',
'startDate' => '2014-05-01',
'endDate' => '2018-07-26',
'access_token' => $accessToken
])
->setHeaders([
'access_token' =>
// $accessToken commented this
])
->get('https://youtubeanalytics.googleapis.com/v2/reports');
print_r($result); exit;