嘿,我第一次使用 API,我对如何从日历 API 获取事件 ID 感到困惑。目前我正在使用示例 quickstart.php 文件,并从中获取摘要:
$results = $service->events->listEvents($calendarId, $optParams);
$events = $results->getItems();
if (empty($events)) {
print "No upcoming events found.\n";
} else {
print "Upcoming events:\n";
foreach ($events as $event) {
$start = $event->start->dateTime;
if (empty($start)) {
$start = $event->start->date;
}
printf("%s (%s)\n", $event->getSummary(), $start);
}
}
提前致谢。