1.Setup
2.Sample
3.Blog
1.sign up the TRO google account
usr: [email protected]
2.Create a project in Google Developers Console, enable google calendar api in api manager.
3.Install the library(already installed in the server)
In (Google Developer Console)(https://console.developers.google.com/apis/credentials?project=tro-calendar) select your project, then ‘API’s & Auth’, then ‘Credentials’, then ‘Create New Client ID’ and choose ‘Service Account’. You will be prompted to save the private key for the id. Make sure you do save it since it can’t be downloaded later (although you can generate new keys).
Log in to the Calendar using the normal web GUI. Locate the calendar on the left panel under ‘My Calendars’, hover over it to reveal the dropdown arrow, then select ‘Share this Calendar’. Under the ‘Share with specific people’ section, enter the Email Address from the previous step and check it has enough access for your intended use.
setCache(new Google_Cache_File('/home/httpd/www/dev.travelresearchonline.com/public_html/tmp')); $client->setAssertionCredentials($credentials); if ($client->getAuth()->isAccessTokenExpired()) { $client->getAuth()->refreshTokenWithAssertion(); } $service = new Google_Service_Calendar($client); $event = new Google_Service_Calendar_Event(array( //'id' => $calId; 'summary' => $title, 'description' => $details, 'start' => array( 'date' => $start ), 'end' => array( 'date' => $end ), )); $event = $service->events->insert($calendarId, $event); ?>