This guide assumes you've already done the following:
The modification process is very similar to that of creation.
See event model in the reference.
NOTE:
WorkAPI doesn't currently support moving events between providers (it's on the roadmap). This can be accomplished by creating a new event on integration X, and deleting the old one from integration Y.
token = "<user's token>"
client = LivilApi::Service.new(token)
event_id = '...existing event ID...'
event = LivilApi::Event.new(
# `integration_id` is not necessary as it's encoded in the `event_id`
name: 'Test Meeting (Updated)',
start_date_time: '2020-02-01T14:45:00',
start_timezone: 'America/New_York',
end_date_time: '2020-02-01T15:45:00',
end_timezone: 'America/New_York',
all_day: false
)
response = client.modify_event(event_id: event_id, event: event)
response
# => LivilApi::Event(id: '...', name: 'Test Meeting (Updated)', ...)
The provider (Google Calendar, O365) will inform meeting attendees of changes to events made by organizers, and inform organizers of RSVP status changes of the attendees.
In order to change the RSVP status of an attendee (e.g. to accept or decline an event invitation), the `EventAttendee#response_status` attribute can be updated to one of the following values:
needsAction
accepted
tentative
declined
token = "<user's token>"
client = LivilApi::Service.new(token)
event_id = '...existing event ID...'
event = client.get_event(event_id: event_id)
event.attendees
# =< [EventAttendee(..., response_status: 'needsAction')]
event.attendees[0].response_status = 'accepted'
response = client.modify_event(event_id: event_id, event: event)
response
# =< LivilApi::Event(id: '...', attendees: [EventAttendee(..., response_status: 'accepted'), ...)