To create an event, call the events.insert()
method providing at least these parameters:
calendarId
is the calendar identifier and can either be the email address of the calendar on which to create the event or a special keyword 'primary' which will use the primary calendar of the logged in user. If you don't know the email address of the calendar you would like to use, you can check it either in the calendar's settings of the Google Calendar web UI (in the section "Calendar Address") or you can look for it in the result of the calendarList.list()
call.
event is the event to create with all the necessary details such as start and end. The only two required fields are the start and end times.
In order to successfully create events, you need to:
set your OAuth scope to https://www.googleapis.com/auth/calendar.
ensure the authenticated user has write access to the calendar with the calendarId you provided (for example by calling calendarList.get()
for the calendarId and checking the accessRole).
calendarId := "primary"
event, err = srv.Events.Insert(calendarId, event).Do()
if err != nil {
log.Fatalf("Unable to create event. %v\n", err)
}
fmt.Printf("Event created: %s\n", event.HtmlLink)
As per your question you are asking about adding multiple events using batch request.
Google calendar API only has the event adding one by one option in its option as far as I know.
You can also refer to this page for more details
https://developers.google.com/calendar/api/guides/create-events.