0
我使用下面的代碼,它的工作,但突然它不工作。我有另一種方法使用相同的身份驗證自由忙碌,一切正常。以下是我的方法以及控制檯日誌。日曆V3打破,我不知道爲什麼
def createEvent(title, event_description, mentor, mentee, start_time, end_time)
calendar_api = Google::Apis::CalendarV3::CalendarService.new
calendar_api.authorization = @auth
event = Google::Apis::CalendarV3::Event.new(
summary: title,
description: event_description,
start: {
date_time: start_time.iso8601,
time_zone: 'Etc/UTC',
},
end: {
date_time: end_time.iso8601,
time_zone: 'Etc/UTC',
},
attendees: [
{email: mentor},
{email: mentee},
],
reminders: {
use_default: true,
},
)
calendar_api.insert_event('primary', event)
end
我得到控制檯誤差如圖
Sending HTTP post https://www.googleapis.com/calendar/v3/calendars/primary/events?
400
#<Hurley::Response POST https://www.googleapis.com/calendar/v3/calendars/primary/events == 400 (276 bytes) 300ms>
Caught error invalid
Error - #<Google::Apis::ClientError: invalid>
除了提供如上所示的不同錯誤消息之外,仍然不太幸運。 – trowse