###前提・実現したいこと
プログラムにてGoogle Calendarの公開カレンダーを追加(新規作成)できる仕組みを実現したいです。
Google Calendar API を使って公開カレンダーの追加をしようとしています。
###発生している問題・エラーメッセージ
Google Calendar API でカレンダーの追加を実行すると、カレンダーの追加はできているようです(イベントの追加もできます)が、Google CalendarのGUI上に追加したカレンダーが表示されません。
###ソースコード
$scopes = array('https://www.googleapis.com/auth/calendar'); $credential = new Google_Auth_AssertionCredentials($authEmail,$scopes,$p12Key); $client = new Google_Client(); $client->setClientId($clientId); $client->setAssertionCredentials($credential); if ($client->getAuth()->isAccessTokenExpired()) { $client->getAuth()->refreshTokenWithAssertion($credential); } $service = new Google_Service_Calendar($client); $calendar = new Google_Service_Calendar_Calendar(); $calendar->setSummary('Test'); $calendar->setTimeZone('Asia/Tokyo'); $createdCalendar = $service->calendars->insert($calendar);
###補足情報(言語/FW/ツール等のバージョンなど)
開発言語はPHPです。
あなたの回答
tips
プレビュー