Please rate how useful you found this document: 
Average: 1.7 (3 votes)

Google Calendar Examples

The following are examples for Service Task Google Calendar:

Note: The use of the variable @@sub can show different results, depending if this variable was used or not, in some cases the case will not work if the variable is not present.

Create a New Event

REST API: POST https://www.googleapis.com/calendar/v3/calendars/calendarId/events

Parameters:

@@sub //owner of the calendar @@calendarId //calendar event owner

Body:

{ "start": { "dateTime": "@@startTime" }, "end": { "dateTime": "@@endTime" }, "attendees": [ { "email": "@@emailAttFirst", "displayName": "@@nameAttFirst" }, { "email": "@@emailAttSecond", "displayName": "@@nameAttSecond" } ], "summary": "@@eventSummary", "description": "@@eventDescription", "attachments": [ { "fileUrl": "@@fileUrl", "title": "@@fileTitle" } ] }

Example:

Response:

Delete an Event

REST API: DELETE https://www.googleapis.com/calendar/v3/calendars/calendarId/events/eventId

Parameters:

@@sub //owner of the calendar @@calendarId //calendar event owner @@eventId //calendar event id

Body: Not required

Example:

Response:

Get Event for Id

REST API: GET https://www.googleapis.com/calendar/v3/calendars/calendarId/events/eventId

Parameters:

@@sub //owner of the calendar @@calendarId //calendar event owner @@eventId //calendar event id

Body: Not required

Example:

Response:

List Events in My Calendar

REST API: GET https://www.googleapis.com/calendar/v3/calendars/calendarId/events

Parameters:

@@sub //owner of the calendar @@calendarId //calendar event owner

Body: Not required

Example:

Response:

List Calendar

REST API: GET https://www.googleapis.com/calendar/v3/users/me/calendarList

Parameters:

@@sub //owner of the calendar

Body: Not required

Example:

Response:

Update Event

REST API: PUT https://www.googleapis.com/calendar/v3/calendars/calendarId/events/eventId

Parameters:

@@sub //owner of the calendar @@calendarId //calendar event owner @@eventId //calendar event id

Body:

{ "start": { "date": "@@startDate" }, "end": { "date": "@@endDate" }, "attachments": [ { "fileUrl": "@@fileUrl", "title": "@@fileTitle" } ], "attendees": [ { "email": "@@emailAttFirst", "displayName": "@@nameAttFirst" }, { "email": "@@emailAttSecond", "displayName": "@@nameAttSecond" } ], "summary": "@@eventSummary", "description": "@@eventDescription" }

Example:

Response: