I'm following these guides:
- https://developers.google.com/calendar/quickstart/php
- https://developers.google.com/calendar/v3/push
I'm using these libraries:
- https://github.com/googleapis/google-api-php-client-services
- https://github.com/googleapis/google-api-php-client
Here's my current code:
// Get the API client and construct the service object.
// this comes from the Quickstart example:
// https://developers.google.com/calendar/quickstart/php
$client = getClient();
$service = new Google_Service_Calendar($client);
// My code to start watching a channel:
$channel = new Google_Service_Calendar_Channel($client);
// where do I get this ID?
//$channel->setId('20fdedbf0-a845-11e3-1515e2-0800200c9a6689000');
$channel->setType("web_hook");
$channel->setToken('target=myApp-myCalendarChannelDest2');
$channel->setAddress("https://beta.example.com/incoming");
$timetoExpire = time()+360000;
$optParams = array(
'ttl' => $timetoExpire,
);
$channel->setParams($optParams);
$calendarId = 'developer@example.com';
$watchEvent = $service->events->watch($calendarId ,$channel);
Questions:
- How do I start watching the channel for my calendar using those libraries?
- Where do I get
resourcePathfor my calendar? (which is to be used in the abovesetId()method?