Google calendar api - general calendar
Is it possible to share with someone (add or remove user) a specific google calendar using the google api?
I have more than 50 calendars and for each there is a different person who updates the data, I would like to make an "update window" for example. they can only update events on Monday.
+3
source to share
2 answers
This can be done by viewing the API docs for the ACL https://developers.google.com/google-apps/calendar/v2/developers_guide_protocol#AddAcl
+3
source to share
This is an old question, but here's how to share a calendar with a user if someone wants to use it: This is done by ACL Here's an example in php:
public function sharecalendarwithuser($calendar_id, $user_email, $role)
{
$rule = new Google_Service_Calendar_AclRule();
$scope = new Google_Service_Calendar_AclRuleScope();
/*
The type of the scope. Possible values are:
"default" - The public scope. This is the default value.
"user" - Limits the scope to a single user.
"group" - Limits the scope to a group.
"domain" - Limits the scope to a domain.
*/
$scope->setType("user");
$scope->setValue($user_email);
$rule->setScope($scope);
/*
The role assigned to the scope. Possible values are:
"none" - Provides no access.
"freeBusyReader" - Provides read access to free/busy information.
"reader" - Provides read access to the calendar. Private events will appear to users with reader access, but event details will be hidden.
"writer" - Provides read and write access to the calendar. Private events will appear to users with writer access, and event details will be visible.
"owner" - Provides ownership of the calendar. This role has all of the permissions of the writer role with the additional ability to see and manipulate ACLs.
*/
$rule->setRole($role);
$createdRule = $service->acl->insert($calendar_id, $rule);
}
Hope this helps :)
+2
source to share