在第一次邀请仅两名参与者访问API时,我已经超过了日历使用限制。
我尝试从代码中删除参与者,并创建了活动(尽管创建的活动的HTML链接不起作用)
router.get('/calendarapi', function (req, res, next) {
// configure a JWT auth client
var { google } = require('googleapis');
let jwtClient = new google.auth.JWT(
privatekey.client_email,
null,
privatekey.private_key,
['https://www.googleapis.com/auth/spreadsheets',
'https://www.googleapis.com/auth/drive',
'https://www.googleapis.com/auth/calendar']);
//authenticate request
jwtClient.authorize(function (err, tokens) {
if (err) {
console.log(err);
return;
} else {
console.log("Successfully connected!");
let calendar = google.calendar('v3');
var event = {
'summary': 'Google I/O 2015',
'location': '800 Howard St., San Francisco, CA 94103',
'description': 'A chance to hear more about Google\'s developer products.',
'start': {
'dateTime': new Date(2019, 10, 5, 11, 9, 9),
'timeZone': 'Asia/Kolkata',
},
'end': {
'dateTime': new Date(2019, 10, 5, 12, 9, 9),
'timeZone': 'Asia/Kolkata',
},
'recurrence': [
'RRULE:FREQ=DAILY;COUNT=2'
],
'attendees': [
{'email': 'siddharthsogani22@gmail.com'},
{'email': 'siddharthsogani1@gmail.com'},
],
'reminders': {
'useDefault': false,
'overrides': [
{'method': 'email', 'minutes': 24 * 60},
{'method': 'popup', 'minutes': 10},
],
},
};
calendar.events.insert({
auth: jwtClient,
calendarId: 'primary',
resource: event,
}, function (err, event) {
if (err) {
console.log('There was an error contacting the Calendar service: ' + err);
return;
}
console.log('Event created: %s');
res.json(event)
});
}
});
});
我现在该怎么办?身份验证成功进行。该活动是在没有参加者的情况下创建的。但是没有办法弄清楚现在该怎么办?因为这只是第一个API调用,所以我认为它不应该与超出配额有关?请帮忙。