Rails + Google Calendar API events not created
I faced with same problem. Needed give write rules to "client_email" for calendar.
You use organization calendar. Thats why only organization admin can do it.
Add Event to Calendar of another user using Google::Api::V3
The solution to my problem was adding an attendee
to the params of my new event. I specified the email of the host
in this case and the event was added to both the cleaners calendar and the host's calender. Here's my new_event
method that inserts the event into both calendars
def new_event(start, endd, cleaner, host)
client = Signet::OAuth2::Client.new(client_options)
client.update!(session[:authorization])
service = Google::Apis::CalendarV3::CalendarService.new
service.authorization = client
calendar = service.get_calendar(:primary)
today = Date.today
event = Google::Apis::CalendarV3::Event.new({
start: Google::Apis::CalendarV3::EventDateTime.new(date: start),
end: Google::Apis::CalendarV3::EventDateTime.new(date: endd),
attendees: [{email: host.email}],
summary: "Cleaning Scheduled by #{cleaner}"
})
service.insert_event(calendar.id, event)
end
Google Calendar Api : How to send notification email to attendee when i add it to an event?
At calendar API, sendUpdates
is used as the query parameter. So how about this modification?
From:
result = service.update_event(ENV['CALENDAR_ID'], event.id, event)
To:
result = service.update_event(ENV['CALENDAR_ID'], event.id, event, send_updates: 'all')
Reference:
- update_event()
- Events: update
If this was not the result you want, I apologize.
Google Calendar API insert event without auth Rails
I found solution. Needed use server-to-server auth.
Next page has this solution: Rails + Google Calendar API events not created
Related Topics
Rails Activerecord: Saving Nested Models Is Rolled Back
Cannot Install Ruby 1.9.3 on a Clean Lion Install
Importing CSV as Test Data in Cucumber
Make Map Marker Direct Link Onclick for Gmaps4Rails
How to Make the Say Command Echo a Variable Value in a Script
+= Operator Overloading in Ruby
How to Upgrade My Ruby 1.9.2-P0 to the Latest Patch Level Using Rvm
Get File Name and Extension in Ruby
Rails 3 + Daemons Gem: Exception When Querying Model
Sorting of 2D Array by Its Amount of in the Inner Elements
Rails + Google Calendar API Events Not Created
Bug in Implemented Tagging System
Receving the Undefined Method 'Generators' Error