Google Calendar Events List not returning an object
See original GitHub issueHello,
I’m trying to get a list of events from the Calendar api. Specifically the calendar.events.list api. On the https://developers.google.com/calendar/v3/reference/events/list it states that it should return events from the calendar. When using the base code from the quickstart https://developers.google.com/calendar/quickstart/nodejs it works perfectly. But i want the listEvents function to return an object and not just console out the events. So when i change the listEvents function from
const calendar = google.calendar({version: 'v3', auth});
calendar.events.list({
calendarId: 'primary',
timeMin: (new Date()).toISOString(),
maxResults: 10,
singleEvents: true,
orderBy: 'startTime',
}, (err, res) => {
if (err) return console.log('The API returned an error: ' + err);
const events = res.data.items;
if (events.length) {
console.log('Upcoming 10 events:');
events.map((event, i) => {
const start = event.start.dateTime || event.start.date;
console.log(`${start} - ${event.summary}`);
});
} else {
console.log('No upcoming events found.');
}
});
}
to
const calendar = google.calendar({version: 'v3', auth});
const results = calendar.events.list({
calendarId: 'primary',
timeMin: (new Date()).toISOString(),
maxResults: 10,
singleEvents: true,
orderBy: 'startTime',
});
console.log(results);
}
results is just undefined. Am i missing something? Thanks in advanced.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Google calendar API do not return events list - Stack Overflow
Same problem here. A secondary calendar with plenty of recurring events (visible in web GUI) but using python API, events().list() does NOT ......
Read more >Events | Google Calendar
Property name Value Notes
anyoneCanAddSelf boolean writable
attachments list
attachments.fileId string
Read more >Google Calendar API events list does not return al...
I have some python script that calls Google Calendar API events list with start and end set. It seems that there is an...
Read more >calendar.events.list - Calendar | AnyAPI Documentation
Once this feature is shutdown, the API will no longer return reminders using this method. Any newly added SMS reminders will be ignored....
Read more >events() - Google APIs
Returns an event based on its Google Calendar ID. To retrieve an event using its iCalendar ID, call the events.list method using the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed the error. The quickstart says to use
npm install googleapis@27 --save
but after uninstalling it and using the most recent version it works.The quickstart should be updated to say
npm install googleapis --save
instead of @27Hi @Smarto-Dev, Sorry for the late reply. If you’re still having issues I’d be happy to help. I solved my issue by using the updated googleapis instead of the version listed in the quickstart.