Google日历API:Domain Global,未find错误

我已经检查了所有类似的线程,并没有find我正在寻找的东西。 这几天我一直在挣扎。

我正在尝试进行忙/闲请求。

代码是相同的有时它返回日历没有错误,有时我得到{域:“全球”,原因:“notFound”}下面的错误

有没有人遇到类似的问题?

googleapis.discover('calendar', 'v3').execute(function(err, client) { var oauth2Client = new OAuth2Client(clientID, secret, callback); oauth2Client.credentials = { access_token: mytoken, refresh_token: refreshtoken } client.calendar.freebusy.query({ "timeMin": day + 'T00:00:00' + finalTimeZone, "timeMax": nextday + 'T00:00:00' + finalTimeZone, 'timeZone': timezone }).withAuthClient(oauth2Client).execute(function(err, result) { if (err) { console.log(err); } else { console.log(result); } }); }); 

结果:

  { kind: "calendar#freeBusy", timeMin: "2013-11-05T08:00:00.000Z", timeMax: "2013-11-06T08:00:00.000Z", calendars: { email@gmail.com: { errors: [ { domain: "global", reason: "notFound" } ], busy: [ ] } } } 

我得到了同样的错误信息。 在我的情况是缺less日历ID。

  client.calendar.events.insert({ calendarId: 'my calendar id' }, { 'start': { 'dateTime': '2014-03-03T01:00:00.000Z' }, 'end': { 'dateTime': '2014-03-03T09:00:00.000Z' } }) .withAuthClient(auth) .execute(function(err, result){ if (err) return callback(err); callback(null, result); }); 

如何发现你的日历ID:http: //youtu.be/m_ph_hYT_SY

通常,日历ID是您正确的电子邮件,或者您可以使用值“主要”。