如何通过PHP中的谷歌日历API检索与我的谷歌日历共享的同事的日历名称?

时间:2015-07-24 06:44:36

标签: php

我正在尝试使用以下代码检索同事的日历名称,但它不起作用。 代码:

$calendarList  = $service->calendarList->listCalendarList();
foreach ($calendarList->getItems() as $calendarListEntry)
{
    print_r($calendarListEntry);
}

1 个答案:

答案 0 :(得分:0)

首先确保您的身份验证SCOPE是日历:

define('SCOPES', implode(' ', array(
  Google_Service_Calendar::CALENDAR)
));

其次,您应该在每个功能文档中使用Google提供的示例代码段。日历列表Source

相关问题