wanasit / google-calendar

Google Calendar API connection in Node.js
MIT License
230 stars 54 forks source link

Get events that are marked as “busy” only #20

Open leopoldjoy opened 8 years ago

leopoldjoy commented 8 years ago

I am using the Google Calendar api to access users' events. I want to access all of the users events that are marked as "busy." I can't use the freebusy api since I need the actual event details. Here's what I currently have:

gcal(accessToken).events.list(
  calendars[inc].id,
  {
    orderBy: 'startTime',
    maxResults: 2500,
    singleEvents: true,
    timeMax: max.toISOString(),
    timeMin: min.toISOString()
  },
  (err, data) => {
    // ...
  }
);

This works fine. How can I limit the results to only events marked as "busy"? (So excluding, for example holidays, or day-long reminder events that the user has marked as "available.")

Thank you

NOTE: this is a duplicate of this StackOverflow post.