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 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?