[英]Google calendar API update “Missing end time”
我正在尝试使用以下命令更新事件:
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."
}
}
如果我只需要更新摘要或其他字段,为什么还需要结束时间?
PUT https://www.googleapis.com/calendar/v3/calendars/calendarId/events/eventId
是events.update更新要求填写所有字段。使用它的最佳方式是执行event.get更改您想要的字段然后发回。
更好的选择
如果您只想更新几个字段,请使用events.patch 。
PATCH https://www.googleapis.com/calendar/v3/calendars/calendarId/events/eventId
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.