Calendar Manager node

Calendar Manager node is used to manage the calendar events in the existing calendars.

 

Calendar Manager Node

The Calendar Manager node can be used to Create, Find, List, Remove, or Change calendar events.

Calendar - Select the calendar, you want to manage, from the dropdown.

Action - You can choose the below from the dropdown.

Create - Create a calendar event.

Find - Find a calendar event.

List - List all the calendar events based on a criteria

Remove - Delete a calendar event from the calendar.

Change - Update a calendar event.

Default Timezone - If the event doesn't have a timezone, it will default to US/Eastern.

Create an event

As a voice experience developer, you can create an event using the Calendar manager node.

Calendar - Select your calendar. (Project specific or Global)

Action - Create Event.

Example of Create payload.

{ "title": "Sample_Event", "description": "Sample Event Description", "isAllDay": false, // Boolean // if isAllDay is true, Start date and end date are not necessary. "startDate": "2019-12-30T20:05:25.000Z", // if isAllDay is false "endDate": "2019-12-30T20:10:25.000Z", // if isAllDay is false "duration": 60, "createdBy": "5cf91e4a37e124a030877808", "participants": [ { "user": "5d0cb15e58fdf56d009c490d", "token": "AnyUniqueToken" }, { "user": "5cf91e4a37e124a030877808", "token": "AnyUniqueToken" } ], "frequency": { "patterns": { "recurrenceType": "daily", // none, daily, weekly, yearly. "interval": 1 }, "range": { "startDate": "2019-12-30T15:05:25.000Z", // You have to use either occurenceCount or endDate. "occurrencesCount": 1, // the number of times you want the event to recur. // "endDate":"2019-12-30T15:15:25.000Z", } } }

Remove the comments before copying the code to the Calendar Manager node.

Find an event

You can find the calendar event ID in the output payload of the calendar manager node at msg.data.calendarData._id
You can use that calendar event ID to find the event.

Calendar - Select your calendar. (Project specific or Global)

Action - Find Event.

Example for Find payload

{ "id": "5e09fa7f532bb6007859bfcb" }

List events

You can list all the events based on criteria such as events within a specific time frame, events of a user, events of a participant and so on.

The below example will list all the events in a participant's calendar, which are created by the user, within the time frame given.

Calendar - Select your calendar. (Project specific or Global)

Action - List Events.

Example of List payload.

{ "fromDate":"2017-07-05", "fromTime": "19:20", "toDate": "2017-07-05", "toTime": "19:20", "attributes":{"label": "notelabel-1,test" }, "user": "5953eb01bc64b00f3445c2c9", "participants":"5953eb01bc64b00f3445c2c9" }

Attributes have 2 properties: text and label.

Change event

You can update a calendar event using the change event action.

Calendar - Select your calendar. (Project specific or Global)

Action - Change Events.

Example of Change payload for a non-recurring event.

Remove the comments before copying the code to the Calendar Manager node.

Example of Change payload for a recurring event.

Remove the comments before copying the code to the Calendar Manager node.

When the recurring option is changed, updateOption should be set as ALL.
When the updateOption is set as ALL, the isAncestorEvent should be set false and the isParent should be set as true.

Delete an event

Calendar - Select your calendar. (Project specific or Global)

Action - Remove Events.

Example of Remove payload.

The above code can be used to Remove the details of a specific event if you already know the Event ID.

The Calendar Manager node expects a currentUserId.

Related Articles