Google Calendar API v3 - Not Creating Event (Server-to-Server Authentication)

风格不统一 提交于 2019-11-28 10:32:19
Vinicius Pinto

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);

Reference: Who owns calendars created by service account via Google Calendar API and how can they be shared?

PS: there's a new version of the PHP client library.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!