Create event in Zoho Calendar
Table of Contents
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
reminders_list
dateandtime_map
attendees_list
"calendar_connection"
Response format
Success ResponseThe 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"
}
]
}
The failure response for incorrect Calendar UID will be returned in the following format:
{
"error": [
{
"description": "Calendar not found",
"message": "CALENDAR_NOTFOUND"
}
]
}