2010-08-09 123 views

回答

4

从谷歌日历API文档:Sharing calendars

+0

我用它,但无法分享我的日历 – Manish 2010-08-09 13:42:30

+2

API的工作原理。现在,如果你没有告诉我们你是如何使用它的,我们无法帮助你。 – 2010-08-09 13:52:44

+0

该链接无效! – Mishax 2016-09-19 16:05:54

0

试试这个功能,看看它是否工作。这将使日历在您的域内广泛分享。

function updateACLRole($cal_id, $USER) { 
    $data = "<entry xmlns='http://www.w3.org/2005/Atom' xmlns:gAcl='http://schemas.google.com/acl/2007' > 
     <category scheme='http://schemas.google.com/g/2005#kind' 
     term='http://schemas.google.com/acl/2007#accessRule'/> 
     <gAcl:scope type='domain' value='".$this->CONSUMER_KEY."' ></gAcl:scope> 
     <gAcl:role value='http://schemas.google.com/gCal/2005#read'></gAcl:role> 
    </entry>"; 
    $uri = 'https://www.google.com/calendar/feeds/' . $cal_id . '/acl/full/domain%3A'.$this->CONSUMER_KEY.'?xoauth_requestor_id=' . urlencode($USER); 

    $result = $this->gdataCal->put($data, $uri); 

}