Maybe it is a bit too late... but you have to setup an authentification.
Here is the code I used for mine, hope it can helps people still looking for this (Note that I used the api PHP client the class name may differ from yours but the logic is still the same):
require_once 'Google/Client.php'; require_once 'Google/Service/Calendar.php'; session_start(); $client = new Google_Client(); $client->setApplicationName("Google Calendar PHP Starter Application"); // Visit https://code.google.com/apis/console?api=calendar to generate your // client id, client secret, and to register your redirect uri. $client->setClientId(''); $client->setClientSecret(''); $client->setRedirectUri(''); $client->setDeveloperKey(''); $client->setScopes(array( 'https://www.googleapis.com/auth/plus.me', 'https://www.googleapis.com/auth/userinfo.email', 'https://www.googleapis.com/auth/userinfo.profile', 'https://www.googleapis.com/auth/calendar', 'https://www.googleapis.com/auth/calendar.readonly' )); $cal = new Google_Service_Calendar($client); if (isset($_GET['logout'])) { unset($_SESSION['token']); } if (isset($_GET['code'])) { $client->authenticate($_GET['code']); $_SESSION['token'] = $client->getAccessToken(); header('Location: http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']); } if (isset($_SESSION['token'])) { $client->setAccessToken($_SESSION['token']); } if ($client->getAccessToken()) { $event = new Google_Service_Calendar_Event(); $event->setSummary($title); $event->setLocation($location); $start = new Google_Service_Calendar_EventDateTime(); $start->setTimeZone('America/Montreal'); $start->setDateTime($date . 'T' . $startTime . ':00.000-06:00'); $event->setStart($start); $end = new Google_Service_Calendar_EventDateTime(); $end->setTimeZone('America/Montreal'); $end->setDateTime($date . 'T' . $endTime . ':00.000-06:00'); $event->setEnd($end); $attendee1 = new Google_Service_Calendar_EventAttendee(); $attendee1->setEmail($email); $attendees = array($attendee1); $event->attendees = $attendees; $cal->events->insert($email, $event); $_SESSION['token'] = $client->getAccessToken(); } else { $authUrl = $client->createAuthUrl(); print "<a class='login' href='$authUrl'>Connect me!</a>"; }