1
我有一個網站,用戶希望有他們的谷歌日曆 所有的例子似乎有日曆的所有者每次驗證。 有沒有辦法驗證我的應用程序來獲取用戶日曆數據並顯示它?從谷歌日曆檢索事件使用PHP API脫機
我試圖挽救車主的access_token
他們接受後,我的應用程序,但過了一會兒,我得到了以下錯誤:
The OAuth 2.0 access token has expired, and a refresh token is not available. Refresh tokens are not returned for responses that were auto-approved.
這是我想要的代碼(BTW的config.php文件有所有的API東西填寫)
$client = new Google_Client();
$client->setUseObjects(true);
$client->setApplicationName("My Unit Calendar");
$client->setAccessType('offline');
$client->setAccessToken($row['access_token']); //from the DB
$calService = new Google_CalendarService($client);
$events = $calService->events->listEvents($row['google_cal_id']); //from the DB
echo "events--><pre>".print_r($events,true)."</pre>";
,但我得到以下異常:
Google_AuthException-->The OAuth 2.0 access token has expired, and a refresh token is not available. Refresh tokens are not returned for responses that were auto-approved.
感謝您的任何幫助