[英]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.