Create event in Zoho Calendar
Table of Contents
Note:
- Each time the zoho.calendar.createEvent integration task is executed, it triggers an API request in the back-end. This call is deducted from the external calls limit available for the service from which the task is executed, based on your pricing plan.
- Only actual executions that receive a response (whether success or failure) are counted, not the number of times the task appears in the script. For example, if zoho.calendar.createEvent integration task is placed inside a for each task that iterates five times, the number of external calls consumed will be five, even though the task appears only once in the script.
Overview
This task is used to create an event in Zoho Calendar.
This task is based on Zoho Calendar API -> Create new event.
Syntax
<variable> = zoho.calendar.createEvent(<calendar_uid>, <event_details_map>, <connection>);
| Parameter | Data type | Description |
| <variable> | KEY-VALUE | Variable to hold the response returned by Zoho Calendar. |
| <calendar_uid> | TEXT | The unique identifier of the calendar in which the event needs to be created. Note: Click here to learn how to get your calendar UID. |
| <event_details_map> | KEY-VALUE | The details of the event that needs to be created. Note: The keys and values to this parameter should be provided as specified in the Zoho Calendar API. |
| <connection> | TEXT | is the link name of the Zoho Calendar connection Note:
|
Create an event in Zoho Calendar
The following script creates an event in the specified Zoho Calendar.
reminder1 = Map(); reminder1.put("action", "popup"); reminder1.put("minutes", "-60"); reminders_list = List(); reminders_list.add(reminder1); dateandtime_map = Map(); dateandtime_map.put("timezone", "Asia/Calcutta"); dateandtime_map.put("start", "20200201T153000+0530"); dateandtime_map.put("end", "20200202T163000+0530"); attendees_list = List(); attendees_list.add({"email":"shawn@zylker.com"}); attendees_list.add({"email":"hailee@zylker.com"}); eventDetails=Map(); eventDetails.put("estatus", "added"); eventDetails.put("title", "Zylker invitation"); eventDetails.put("reminders", reminders_list); eventDetails.put("dateandtime", dateandtime_map); eventDetails.put("isallday", "true"); eventDetails.put("attendees", attendees_list); event=Map(); event.put("eventdata", eventDetails); response = zoho.calendar.createEvent("18027XXXXXXXXXXXXXXXXXXXXXX5e986", event, "calendar_connection");
where:
event
The KEY-VALUE that holds the details of the event that needs to be created
reminders_list
The LIST variable that holds the type of reminders to be set for the event
dateandtime_map
The KEY-VALUE variable that holds the date and time of the event
attendees_list
The LIST variable that holds the attendees information
"calendar_connection"
The TEXT that represents the Zoho Calendar connection
Response format
Success Response
The success response will be returned in the following format:
{
"events": [
{
"isprivate": false,
"reminders": [
{
"minutes": "-60",
"action": "popup"
}
],
"enable_eventmanagement": false,
"role": "organizer",
"color": "",
"attendees": [
{
"privilege": 1,
"email": "shawn@zylker.com",
"attendance": 1,
"status": "NEEDS-ACTION"
},
{
"privilege": 4,
"email": "hanna@zylker.com",
"attendance": 1,
"status": "ACCEPTED"
}
],
"calid": "34888000000002003",
"has_attachment": false,
"title": "Zylker invitation",
"createdtime": "20200109T104840Z",
"calendar_alarm": false,
"duration": "3600000",
"uid": "172835038a0f4c7b8aea094688e700ad@zoho.com",
"estatus": "added",
"organizer": "hanna@zylker.com",
"isallday": false,
"modifiedby": "hanna@zylker.com",
"etag": "1578566920936",
"caluid": "18027611702d41af8942935faab5e986",
"multiday": false,
"id": 34888000000006019,
"dateandtime": {
"timezone": "Asia/Calcutta",
"start": "20200126T153000+0530",
"end": "20200126T163000+0530"
},
"lastmodifiedtime": "20200109T104840Z"
}
]
}
Failure Response
The failure response for incorrect Calendar UID will be returned in the following format:
{
"error": [
{
"description": "Calendar not found",
"message": "CALENDAR_NOTFOUND"
}
]
}