我终于可以得到一个访问令牌,现在我非常困惑如何添加一个日历仅使用谷歌提供的apiClient。
$apiClient = SiteController::getApiClient();
$service = new apiCalendarService($apiClient);
$calendar = new Calendar();
$calendar->description = "What";
$service->calendars->insert($calendar);这就产生了:
Error calling POST https://www.googleapis.com/calendar/v3/calendars?key=mykey: (400) Required是否有关于添加日历的文档/示例?似乎有很多简单的添加事件的例子。
我现在离得更近了
apiServiceException
Error calling POST
https://www.googleapis.com/calendar/v3/users/me/calendarList?key=mykey: (404) Not Found使用他们在文档中提供的样板代码
$calendarListEntry = new CalendarListEntry();
$calendarListEntry->setId("calendarId");
$createdCalendarListEntry = $service->calendarList->insert($calendarListEntry);
echo $createdCalendarListEntry->getSummary();如何更改请求URL
https://www.googleapis.com/calendar/v3/users/me/calendarList?key=mykey至
https://www.googleapis.com/calendar/v3/calendars这是有效的: //创建新日历$apiClient = SiteController::getApiClient();
$service = new apiCalendarService($apiClient);
$calendar = new Calendar();
$calendar->setSummary(Home::model()->count() . '-' . $model->name);
$createdCalendar = $service->calendars->insert($calendar);发布于 2012-06-28 03:11:01
您可以参考Google v1开发人员指南。
https://stackoverflow.com/questions/11237029
复制相似问题