dozpox8752 2012-06-12 11:06
浏览 50
已采纳

Google日历API V3更新活动

I can perfectly add an event with Google Calendar API V3 as described in https://developers.google.com/google-apps/calendar/recurringevents but I can't figure how to start on the update event process.

I guess I have to select the event (I do have the event ID stored on my DB) and then set the parameters and call an update event. But don't know where to start...

There seems to be very few tutorials around. Any ideas please?

  • 写回答

1条回答 默认 最新

  • dqde43215 2012-06-12 12:13
    关注

    Ok I finally got the answer my self. Struggled to read on those Google API Explorer and matching them against the google-api-php-client. Anyway, here it is a simple code to update the description, summary and event color.

    $apiClient = new apiClient();
    $apiClient->setUseObjects(true);
    $service   = new apiCalendarService($apiClient);
    $events    = $service->events;
    
    $currEvent  = $events->get("primary", $event_id);
    
    $currEvent->setDescription("YOUR FULL DESCRIPTION");
    $currEvent->setSummary("YOUR DESIRED SUMMARY - Kind of title");
    $currEvent->setColorId(2); // One of the available colors ID
    
    $recurringEvent = $events->update('primary', $event_id, $currEvent);
    

    Remember that this code needs to be ran only after authentication. Hope it helps someone. It did me ;)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效