I am using google calendar API v3 for displaying public events from my google calendar.
Here is the piece of code
require_once 'google-api-php-client-read-only/src/Google_Client.php';
require_once 'google-api-php-client-read-only/src/contrib/Google_CalendarService.php';
session_start();
$client = new Google_Client();
$client->setApplicationName("Calendar API Project");
$client->setDeveloperKey('xxxxxxxxxxxxxxx');
$service = new Google_CalendarService($client);
$events = $service->events->listEvents('u8v19163rlkb6qkhpj3e0ag2g0@group.calendar.google.com',array('maxResults'=>15));
$event = $service->events->get('u8v19163rlkb6qkhpj3e0ag2g0@group.calendar.google.com', $id);
$events = $events['items'];
foreach($events as $key=>$val){
$events[] = $service->events->get('u8v19163rlkb6qkhpj3e0ag2g0@group.calendar.google.com', $val['id']);
}
The problem is i am getting all the information related to events , except event colors.
Please help.
Had a same problem but by assigning the "Make Changes to events" permission to the client email address that is associated to the calendar solved the problem for me.
https://github.com/google/google-api-php-client/issues/441
["items"]=>
array(1) {
[0]=>
array(16) {
["kind"]=>
string(14) "calendar#event"
["etag"]=>
string(18) ""2917142762918000""
["id"]=>
string(26) "fmpd364h5pdu0u4oc66de8obao"
["status"]=>
string(9) "confirmed"
["htmlLink"]=>
string(116) "https://www.google.com/calendar/event?eid=Zm1wZDM2NGg1cGR1MHU0b2M2NmRlOG9iYW8gMWVxNW9zYXFsdGc4bThhcTE4YmpuampiYmtAZw"
["created"]=>
string(24) "2016-03-21T14:04:24.000Z"
["updated"]=>
string(24) "2016-03-21T14:43:01.459Z"
["summary"]=>
string(4) "test"
["colorId"]=>
string(2) "11"