我正在嘗試使用Google Calendar API在Google日曆中插入事件。Google Cal API - 插入事件時「缺少結束時間」
事件資源,我將:
{
"summary": "test",
"location": "test",
"description": "test",
"start": {
"dateTime": "2015-11-02T10:00:00-05:00",
"timeZone": "America/Toronto"
},
"end": {
"dateTime": "2015-11-02T11:00:00-05:00",
"timeZone": "America/Toronto"
},
"attachments": [
{
"fileUrl": ""
}
],
"attendees": [
{
"email": "[email protected]"
},
{
"email": "[email protected]"
}
],
"reminders": {
"useDefault": false,
"overrides": [
{
"method": "email",
"minutes": 1440
},
{
"method": "popup",
"minutes": 10
}
]
}
}
此事件被作爲一個POST請求https://www.googleapis.com/calendar/v3/calendars/calendarId/events的身體。我沒有使用任何圖書館。
我一直得到「缺少結束時間」的錯誤。我發現了一些類似的問題,如this one,他(她)是一個使用JavaScript庫,並建議發送以下爲正文:
{
resource:<event above>,
calendarId:<calendarId>
}
但這並沒有在我的情況下工作,也許是因爲我不不要使用圖書館。我不認爲它很重要,但我在Meteor應用程序中這樣做。任何想法?
編輯 原來這畢竟是流星相關的問題。我在使用他們的HTTP lib時犯了一個錯誤。
原來這是最後一個流星相關的問題。我用他們的http庫犯了一個錯誤。對不起,並感謝你 – znat
Np我試過,因爲我有一個日期問題一次。這可能會很棘手。 – DaImTo