我检查了所有类似的线程,但没有找到我要找的东西。在过去的几天里,我一直在挣扎。
我正在尝试提出忙/闲请求。
代码是相同的,有时它会返回没有错误的日历,有时我会收到以下错误{ domain: "global", reason: "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: [ ]
}
}
}