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


How to retrieve the colleague's calendar name shared with my google calendar through google calendar API in PHP?

我试图通过使用下面的代码检索同事的日历名称,但它不起作用。代码:

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

首先确保您的身份验证范围为Calendar:

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

其次,您应该在每个特性文档中使用Google提供的示例片段。日历列表来源