I’m developing a Ruby on Rails application and I need to ensure that when a meeting is scheduled using Calendly, it also blocks the corresponding time slots in Google Calendar for all attendees involved.
Attempts I’ve Made
I’ve been utilizing the following Google Calendar API components:
While the event is successfully created and reminders are sent, the time slots on the attendees’ Google Calendars aren’t showing as busy. How can I ensure that these slots are marked as unavailable to prevent double booking?
Your code looks right, but you’re missing a key piece. Attendees can’t see busy time because you need to set event transparency and fix calendar permissions. First, add this to your event creation:
appointment.transparency = 'opaque' # This marks time as busy
appointment.visibility = 'default'
Second problem: authentication scope. Use the organizer’s credentials with the calendar service, not a service account. Service accounts can create events but won’t affect busy/free status for regular users. Here’s the real trick - attendees need to accept invitations for their calendars to show busy time. You can force this:
This might not work depending on domain policies though. Alternative is creating separate events on each attendee’s calendar using their individual auth tokens, but managing OAuth for multiple users gets complicated fast.
This happens because Google Calendar separates event creation from marking people as busy. Creating an event with attendees won’t automatically block their time unless you meet certain conditions. I hit this same issue building a booking system last year. You need the sendNotifications parameter and proper calendar access. Add this to your insert_event call: ruby calendar_service.insert_event('primary', appointment, send_notifications: true) The bigger issue is the calendar ID. Don’t use ‘primary’ - loop through each attendee’s calendar if you’ve got access: ruby attendees.each do |attendee_email| calendar_service.insert_event(attendee_email, appointment) end You’ll need OAuth setup for each user though. You can also set guestsCanSeeOtherGuests to false and add conferenceData for video meetings. Google’s busy status takes up to 15 minutes to update, so don’t expect instant results.
The problem is that creating events on the primary calendar doesn’t block time for attendees. You’d need to create events directly on each person’s calendar or handle busy status differently.
But managing calendar sync in Rails gets messy quick. You’re looking at webhooks for Calendly events, looping through attendees, handling auth for each Google account, dealing with rate limits, and managing failures.
I’ve been down this road before. What worked way better was an automation workflow that handles everything without touching Rails.
Set up a workflow that triggers when Calendly schedules something, grabs attendee info and meeting details, then creates blocking events on everyone’s Google Calendar. It handles API calls, retries, and errors automatically.
This approach keeps your Rails app focused on business logic instead of calendar sync headaches. Plus it’s much easier to debug and tweak when the calendar logic isn’t buried in your app code.
Latenode makes this kind of automation pretty straightforward. You can build the whole Calendly to Google Calendar sync visually without writing integration code.
Been wrestling with calendar sync for years and this comes up all the time. The real problem isn’t your code - Google Calendar handles busy time weird.
When you create an event with attendees, Google doesn’t mark their time as busy automatically. Attendees have to accept the invitation or you need to create the event directly on their calendars.
Here’s what works:
# Set the event to show as busy
appointment.transparency = 'opaque'
# Most important - send invites
calendar_service.insert_event('primary', appointment,
send_notifications: true,
send_updates: 'all'
)
But attendees still need to accept for their calendars to show busy. Want guaranteed blocking? You have to create events on each person’s calendar using their auth tokens.
This gets messy fast with OAuth for multiple users. I ended up handling it outside Rails entirely using workflow automation that manages the API calls and auth headaches.
The video shows how transparency settings work in Google Calendar events. Really helped me understand why some events block time and others don’t.
One more thing - Google’s busy status takes 10-15 minutes to propagate, so don’t panic if it doesn’t show immediately.