I want to make this YouTube Analytics Request with the PHP Client Libary
https://www.googleapis.com/youtube/analytics/v1/reports
?ids=channel==CHANNELID
You can add metrics in the following way rather than calling each metric one by one.
$metrics = 'views,estimatedMinutesWatched,averageViewDuration,comments,favoritesAdded,favoritesRemoved,likes,dislikes,shares,subscribersGained,subscribersLost';
Your result will be in the from as depicted in the documentation. Example:
$optparams = array(
'dimensions' => '7DayTotals',
'sort' => 'day',
);
$metrics = 'views,estimatedMinutesWatched,averageViewDuration,comments,favoritesAdded,favoritesRemoved,likes,dislikes,shares,subscribersGained,subscribersLost';
$api_response = $metrics;
$api = $analytics->reports->query($id, $start_date, $end_date, $metric, $optparams);
if (isset($api['rows'])) {
//Get values in form of multidimensional arrays.
}