Imports an event. This operation is used to add a private copy of an existing event to a calendar. Only events with an eventType
of default
may be imported.
Deprecated behavior:
If a non- default
event is imported, its type will be changed to default
and any event-type-specific properties it may have will be dropped.
Request
HTTP request
POST https://www.googleapis.com/calendar/v3/calendars/ calendarId /events/import
Parameters
calendarId
string
primary
" keyword.conferenceDataVersion
integer
0
to 1
, inclusive.supportsAttachments
boolean
Authorization
This request requires authorization with at least one of the following scopes:
Scope |
---|
https://www.googleapis.com/auth/calendar
|
https://www.googleapis.com/auth/calendar.events
|
https://www.googleapis.com/auth/calendar.app.created
|
https://www.googleapis.com/auth/calendar.events.owned
|
For more information, see the authentication and authorization page.
Request body
In the request body, supply an Events resource with the following properties:
end
nested object
iCalUID
string
Note that the iCalUID
and the id
are not identical and only one of them should be supplied at event creation time. One difference in their semantics is that in recurring events, all occurrences of one event have different id
s while they all share the same iCalUID
s. To retrieve an event using its iCalUID
, call the events.list method using the iCalUID
parameter
. To retrieve an event using its id
, call the events.get
method.
start
nested object
anyoneCanAddSelf
boolean
attendees[]
list
attendees[].
additionalGuests
integer
attendees[].
displayName
string
attendees[].
email
string
Required when adding an attendee.
attendees[].
optional
boolean
attendees[].
resource
boolean
attendees[].
responseStatus
string
- "
needsAction
" - The attendee has not responded to the invitation (recommended for new events). - "
declined
" - The attendee has declined the invitation. - "
tentative
" - The attendee has tentatively accepted the invitation. - "
accepted
" - The attendee has accepted the invitation.
attendeesOmitted
boolean
maxAttendee
query parameter. When updating an event, this can be used to only update the participant's response. Optional. The default is False.colorId
string
event
section of the colors definition (see the colors endpoint
). Optional.conferenceData
nested object
createRequest
field. To persist your changes, remember to set the conferenceDataVersion
request parameter to 1
for all event modification requests.description
string
end.
date
date
end.
dateTime
datetime
timeZone
. end.
timeZone
string
extendedProperties.
private
object
focusTimeProperties
nested object
eventType
is focusTime
. gadget.
display
string
- "
icon
" - The gadget displays next to the event's title in the calendar view. - "
chip
" - The gadget displays when the event is clicked.
gadget.
height
integer
gadget.
iconLink
string
gadget.
link
string
gadget.
preferences
object
gadget.
title
string
gadget.
type
string
gadget.
width
integer
guestsCanInviteOthers
boolean
guestsCanModify
boolean
guestsCanSeeOtherGuests
boolean
location
string
organizer
object
attendees
with the organizer
field set to True. To change the organizer, use the move
operation. Read-only, except when importing an event. organizer.
displayName
string
organizer.
email
string
originalStartTime.
date
date
originalStartTime.
dateTime
datetime
timeZone
. originalStartTime.
timeZone
string
outOfOfficeProperties
nested object
eventType
is outOfOffice
.recurrence[]
list
start
and end
fields. This field is omitted for single events or instances of recurring events. reminders.
overrides[]
list
reminders.overrides[].
method
string
- "
email
" - Reminders are sent via email. - "
popup
" - Reminders are sent via a UI popup.
Required when adding a reminder.
reminders.overrides[].
minutes
integer
Required when adding a reminder.
reminders.
useDefault
boolean
sequence
integer
source.
title
string
source.
url
string
start.
date
date
start.
dateTime
datetime
timeZone
. start.
timeZone
string
status
string
- "
confirmed
" - The event is confirmed. This is the default status. - "
tentative
" - The event is tentatively confirmed. - "
cancelled
" - The event is cancelled (deleted). The list method returns cancelled events only on incremental sync (whensyncToken
orupdatedMin
are specified) or if theshowDeleted
flag is set totrue
. The get method always returns them.A cancelled status represents two different states depending on the event type:
- Cancelled exceptions of an uncancelled recurring event indicate that this instance should no longer be presented to the user. Clients should store these events for the lifetime of the parent recurring event.
Cancelled exceptions are only guaranteed to have values for the
id
,recurringEventId
andoriginalStartTime
fields populated. The other fields might be empty. - All other cancelled events represent deleted events. Clients should remove their locally synced copies. Such cancelled events will eventually disappear, so do not rely on them being available indefinitely.
Deleted events are only guaranteed to have the
id
field populated.
showDeleted
set to false will not return these details.If an event changes its organizer (for example via the move operation) and the original organizer is not on the attendee list, it will leave behind a cancelled event where only the
id
field is guaranteed to be populated. - Cancelled exceptions of an uncancelled recurring event indicate that this instance should no longer be presented to the user. Clients should store these events for the lifetime of the parent recurring event.
summary
string
transparency
string
- "
opaque
" - Default value. The event does block time on the calendar. This is equivalent to setting Show me asto Busyin the Calendar UI. - "
transparent
" - The event does not block time on the calendar. This is equivalent to setting Show me asto Availablein the Calendar UI.
visibility
string
- "
default
" - Uses the default visibility for events on the calendar. This is the default value. - "
public
" - The event is public and event details are visible to all readers of the calendar. - "
private
" - The event is private and only event attendees may view event details. - "
confidential
" - The event is private. This value is provided for compatibility reasons.
Response
If successful, this method returns an Events resource in the response body.
Try it!
Use the APIs Explorer below to call this method on live data and see the response.
attendees[]. comment
string