Google日历API更新“缺少结束时间” [英] Google calendar API update "Missing end time"

查看:162
本文介绍了Google日历API更新“缺少结束时间”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用以下内容更新活动:

I'm trying to update an event using:

PUT https://www.googleapis.com/calendar/v3/calendars/primary/events/q4es0o2o70naq8idj1dj6q4354

{
 "reminders" {"useDefault":true},
 "summary":"updatedsummary",
 "description":"updated desc"
}

但得到答复:

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "required",
    "message": "Missing end time."
   }
  ],
  "code": 400,
  "message": "Missing end time."
 }
}

如果我需要,为什么需要结束时间?更新摘要或其他字段?

Why do I need a end time if I just need to update a summary or other fields?

推荐答案

PUT https://www.googleapis.com/calendar/v3/calendars/calendarId/events/eventId

events.update 更新要求填写所有字段。使用它的最佳方式是执行 event.get 更改您想要的字段,然后发布返回。

is events.update update requires that all of the fields be filled in. The best way to use it would be to do an event.get change the fields you want then post that back.

更好的选择

使用 events.patch ,只需要更新几个字段。

Use events.patch instead if you just want to update a few fields.

PATCH https://www.googleapis.com/calendar/v3/calendars/calendarId/events/eventId

这篇关于Google日历API更新“缺少结束时间”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆