更新时间:2023-02-14 13:13:07
它是在服务帐户拥有的日历中创建事件,如果你想管理它,你必须与自己共享日历(!):
It's creating the event in the calendar owned by the service account, if you want to manage it, you have to share the calendar with yourself (!):
$scope = new Google_AclRuleScope();
$scope->setType('user');
$scope->setValue('YOUR-EMAIL-HERE');
$rule = new Google_AclRule();
$rule->setRole('owner');
$rule->setScope($scope);
$result = $service->acl->insert('primary', $rule);
参考:谁拥有服务帐户通过 Google Calendar API 创建的日历以及如何共享这些日历?
PS:有新版本的 PHP 客户端库.
PS: there's a new version of the PHP client library.