I am using v3 of the php google calendar api.
After the calendar owner authorizes i save the access_token with the refresh token in the database.
When the calendar page is displayed by anyone i have this little bit of code that works
$client = new apiClient();
$client->setApplicationName("My Calendar");
$client->setAccessType('offline');
$client->setAccessToken( $_SESSION['google']['access_token'] );
$calService = new apiCalendarService($client);
$optParams = array('timeMin' => $gstart, 'timeMax'=> $gend);
$events = $calService->events->listEvents($_SESSION['google']['google_cal_id'], $optParams);
I have seen in the doc that at some point i may have to use the refresh token(which i have in the database.) What i do not know is how to use this token and when. Will setAccessToken thrown an exception at some point? What is the best way to test this as well Thanks