douzhan1994 2013-10-09 09:19
浏览 76

没有从谷歌日历API v3获取谷歌日历事件的颜色ID

I am using google calendar API v3 for displaying public events from my google calendar.

Here is the piece of code

require_once 'google-api-php-client-read-only/src/Google_Client.php';
require_once 'google-api-php-client-read-only/src/contrib/Google_CalendarService.php';
session_start();
$client = new Google_Client();
$client->setApplicationName("Calendar API Project");
$client->setDeveloperKey('xxxxxxxxxxxxxxx');
$service = new Google_CalendarService($client);
$events = $service->events->listEvents('u8v19163rlkb6qkhpj3e0ag2g0@group.calendar.google.com',array('maxResults'=>15));
$event = $service->events->get('u8v19163rlkb6qkhpj3e0ag2g0@group.calendar.google.com', $id);
$events = $events['items'];

foreach($events as $key=>$val){
    $events[] = $service->events->get('u8v19163rlkb6qkhpj3e0ag2g0@group.calendar.google.com', $val['id']);
}

The problem is i am getting all the information related to events , except event colors.

Please help.

  • 写回答

1条回答 默认 最新

  • doukeyong3746487 2016-03-21 15:09
    关注

    Had a same problem but by assigning the "Make Changes to events" permission to the client email address that is associated to the calendar solved the problem for me.

    https://github.com/google/google-api-php-client/issues/441

        ["items"]=>
    array(1) {
      [0]=>
      array(16) {
        ["kind"]=>
        string(14) "calendar#event"
        ["etag"]=>
        string(18) ""2917142762918000""
        ["id"]=>
        string(26) "fmpd364h5pdu0u4oc66de8obao"
        ["status"]=>
        string(9) "confirmed"
        ["htmlLink"]=>
        string(116) "https://www.google.com/calendar/event?eid=Zm1wZDM2NGg1cGR1MHU0b2M2NmRlOG9iYW8gMWVxNW9zYXFsdGc4bThhcTE4YmpuampiYmtAZw"
        ["created"]=>
        string(24) "2016-03-21T14:04:24.000Z"
        ["updated"]=>
        string(24) "2016-03-21T14:43:01.459Z"
        ["summary"]=>
        string(4) "test"
        ["colorId"]=>
        string(2) "11"
    
    评论

报告相同问题?

悬赏问题

  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
  • ¥15 乘性高斯噪声在深度学习网络中的应用
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 C++ 头文件/宏冲突问题解决