Java 通过Google'共享Google日历;s API

Java 通过Google'共享Google日历;s API,java,google-calendar-api,Java,Google Calendar Api,我可以通过谷歌日历的API在我的帐户中制作谷歌日历,但我也想分享它。有没有一种方法可以通过编程实现这一点?来自Google Calendar API文档:试试这个函数,看看它是否有效。这将使日历在您的域范围内共享 function updateACLRole($cal_id, $USER) { $data = "<entry xmlns='http://www.w3.org/2005/Atom' xmlns:gAcl='http://schemas.google.com/acl/2

我可以通过谷歌日历的API在我的帐户中制作谷歌日历,但我也想分享它。有没有一种方法可以通过编程实现这一点?

来自Google Calendar API文档:

试试这个函数,看看它是否有效。这将使日历在您的域范围内共享

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

}
函数updatealRole($cal\u id,$USER){
$data=”
";
$uri='1https://www.google.com/calendar/feeds/“.$cal\U id.'/acl/full/domain%3A.$this->CONSUMER\U KEY.'?xoauth\U请求者\U id=”。urlencode($USER);
$result=$this->gdataCal->put($data,$uri);
}

我使用了它,但无法在API作品中分享我的日历。现在如果你不告诉我们你是如何使用它的,我们帮不了你多少。这个链接是无效的!