diff --git a/certified-connectors/Zoho Calendar/apiDefinition.swagger.json b/certified-connectors/Zoho Calendar/apiDefinition.swagger.json index 9b248debb5..e7e7496a49 100644 --- a/certified-connectors/Zoho Calendar/apiDefinition.swagger.json +++ b/certified-connectors/Zoho Calendar/apiDefinition.swagger.json @@ -54,8 +54,16 @@ } }, "summary": "Get calendar list", - "description": "Gets the list of all calendars", - "x-ms-visibility": "internal" + "description": "Gets the list of all calendars with the calendar UID, name, and timezone.", + "x-ms-openai-data": { + "openai-enabled": true, + "operations": [ + { + "operationId": "Get_Calendar_List", + "x-ms-require-user-confirmation": false + } + ] + } } }, "/api/v1/calendars/getevents": { @@ -97,10 +105,46 @@ "parameters": [ { "$ref": "#/parameters/cuid" + }, + { + "name": "byinstance", + "type": "boolean", + "in": "query", + "default": true, + "x-ms-summary": "By Instance", + "description": "Retrieves all the instances of repeat events as a separate event when it is set as true. Date range shouldn't exceed 31 days.", + "required": true + }, + { + "name": "start", + "type": "string", + "in": "query", + "required": true, + "description": "Specify the start time in the format yyyy-MM-ddThh:mm:sszzz", + "x-ms-summary": "Start time" + }, + { + "name": "end", + "type": "string", + "in": "query", + "required": true, + "description": "Specify the end time in the format yyyy-MM-ddThh:mm:sszzz", + "x-ms-summary": "End time" + }, + { + "$ref": "#/parameters/timezone" } ], - "description": "Gets the list of all the events", - "x-ms-visibility": "internal" + "description": "Gets the list of all the events between the specified date range in yyyy-MM-ddTHH:mm:sszzz format.", + "x-ms-openai-data": { + "openai-enabled": true, + "operations": [ + { + "operationId": "Get_Event_List", + "x-ms-require-user-confirmation": false + } + ] + } } }, "/api/v1/calendars/event": { @@ -287,7 +331,16 @@ "required": false, "type": "integer" } - ] + ], + "x-ms-openai-data": { + "openai-enabled": false, + "operations": [ + { + "operationId": "Delete_Notification", + "x-ms-require-user-confirmation": true + } + ] + } } }, "/api/v1/webHooksPresence/external/newevent": { @@ -573,7 +626,16 @@ "$ref": "#/parameters/euid" } ], - "description": "Gets the details of a particular event from a specified calendar of the user." + "description": "Gets the details of a particular event such as the event title, start date, end date, etc., from a user's specified calendar.", + "x-ms-openai-data": { + "openai-enabled": true, + "operations": [ + { + "operationId": "Get_Event", + "x-ms-require-user-confirmation": false + } + ] + } } }, "/api/v1/calendars/search": { @@ -687,7 +749,16 @@ "description": "Specify should be searched for in title", "x-ms-summary": "Search text" } - ] + ], + "x-ms-openai-data": { + "openai-enabled": true, + "operations": [ + { + "operationId": "Search_Events", + "x-ms-require-user-confirmation": false + } + ] + } } }, "/api/v1/calendardetail": { @@ -722,7 +793,16 @@ { "$ref": "#/parameters/cuid" } - ] + ], + "x-ms-openai-data": { + "openai-enabled": true, + "operations": [ + { + "operationId": "Get_Calendar_Details", + "x-ms-require-user-confirmation": false + } + ] + } } } }, @@ -816,7 +896,7 @@ "description": "Specify the location of the event", "title": "Location" }, - "url": { + "url": { "type": "string", "description": "Specify the URL of the event", "title": "URL" @@ -829,7 +909,11 @@ "isallday": { "type": "boolean", "description": "Specify if the event is an all day event.", - "title": "Is all day" + "title": "Is all day", + "enum": [ + true, + false + ] }, "attendees": { "type": "array", @@ -939,7 +1023,7 @@ "title": "Location", "description": "The location of the event" }, - "url": { + "url": { "type": "string", "title": "URL", "description": "The URL of the event" @@ -1840,59 +1924,652 @@ "in": "query", "required": true, "type": "string", - "x-ms-dynamic-values": { - "operationId": "Get_Event_List", - "value-path": "uid", - "value-collection": "events", - "value-title": "title", - "parameters": { - "cuid": { - "parameter": "cuid" - } - } - }, "x-ms-summary": "Event", - "description": "Specify event or enter the event's unique id." - } - }, - "responses": {}, - "securityDefinitions": { - "oauth2-auth": { - "type": "oauth2", - "flow": "accessCode", - "tokenUrl": "https://accounts.zoho.com/oauth/v2/token", - "scopes": { - "ZohoCalendar.calendar.ALL": "ZohoCalendar.calendar.ALL", - "ZohoCalendar.event.ALL": "ZohoCalendar.event.ALL", - "ZohoCalendar.settings.ALL": "ZohoCalendar.settings.ALL", - "ZohoCalendar.search.READ": "ZohoCalendar.search.READ" - }, - "authorizationUrl": "https://accounts.zoho.com/oauth/v2/auth" - } - }, - "security": [ - { - "oauth2-auth": [ - "ZohoCalendar.calendar.ALL", - "ZohoCalendar.event.ALL", - "ZohoCalendar.settings.ALL", - "ZohoCalendar.search.READ" - ] - } - ], - "tags": [], - "x-ms-connector-metadata": [ - { - "propertyName": "Website", - "propertyValue": "https://www.zoho.com/zohomail/" + "description": "Enter the event's unique id." }, - { - "propertyName": "Privacy policy", - "propertyValue": "https://www.zoho.com/privacy.html" - }, - { - "propertyName": "Categories", - "propertyValue": "Communication" - } - ] + "timezone": { + "name": "timezone", + "in": "query", + "type": "string", + "description": "Specify the event's timezone", + "x-ms-summary": "Timezone", + "enum": [ + "Etc/GMT+12", + "Etc/GMT+11", + "MIT", + "Pacific/Apia", + "Pacific/Midway", + "Pacific/Niue", + "Pacific/Pago_Pago", + "Pacific/Samoa", + "US/Samoa", + "America/Adak", + "America/Atka", + "Etc/GMT+10", + "HST", + "Pacific/Fakaofo", + "Pacific/Honolulu", + "Pacific/Johnston", + "Pacific/Rarotonga", + "Pacific/Tahiti", + "SystemV/HST10", + "US/Aleutian", + "US/Hawaii", + "Pacific/Marquesas", + "AST", + "America/Anchorage", + "America/Juneau", + "America/Nome", + "America/Yakutat", + "Etc/GMT+9", + "Pacific/Gambier", + "SystemV/YST9", + "SystemV/YST9YDT", + "US/Alaska", + "America/Dawson", + "America/Ensenada", + "America/Los_Angeles", + "America/Tijuana", + "America/Vancouver", + "America/Whitehorse", + "Canada/Pacific", + "Canada/Yukon", + "Etc/GMT+8", + "Mexico/BajaNorte", + "PST", + "PST8PDT", + "Pacific/Pitcairn", + "SystemV/PST8", + "SystemV/PST8PDT", + "US/Pacific", + "America/Boise", + "America/Cambridge_Bay", + "America/Chihuahua", + "America/Dawson_Creek", + "America/Denver", + "America/Edmonton", + "America/Hermosillo", + "America/Inuvik", + "America/Mazatlan", + "America/Phoenix", + "America/Shiprock", + "America/Yellowknife", + "Canada/Mountain", + "Etc/GMT+7", + "MST", + "MST7MDT", + "Mexico/BajaSur", + "Navajo", + "PNT", + "SystemV/MST7", + "SystemV/MST7MDT", + "US/Arizona", + "US/Mountain", + "America/Belize", + "America/Cancun", + "America/Chicago", + "America/Costa_Rica", + "America/El_Salvador", + "America/Guatemala", + "America/Indiana/Knox", + "America/Indiana/Petersburg", + "America/Indiana/Vincennes", + "America/Knox_IN", + "America/Managua", + "America/Menominee", + "America/Merida", + "America/Mexico_City", + "America/Monterrey", + "America/North_Dakota/Center", + "America/North_Dakota/New_Salem", + "America/Rainy_River", + "America/Rankin_Inlet", + "America/Regina", + "America/Swift_Current", + "America/Tegucigalpa", + "America/Winnipeg", + "CST", + "CST6CDT", + "Canada/Central", + "Canada/East-Saskatchewan", + "Canada/Saskatchewan", + "Chile/EasterIsland", + "Etc/GMT+6", + "Mexico/General", + "Pacific/Easter", + "Pacific/Galapagos", + "SystemV/CST6", + "SystemV/CST6CDT", + "US/Central", + "US/Indiana-Starke", + "America/Atikokan", + "America/Bogota", + "America/Cayman", + "America/Coral_Harbour", + "America/Detroit", + "America/Eirunepe", + "America/Fort_Wayne", + "America/Grand_Turk", + "America/Guayaquil", + "America/Havana", + "America/Indiana/Indianapolis", + "America/Indiana/Marengo", + "America/Indiana/Vevay", + "America/Indianapolis", + "America/Iqaluit", + "America/Jamaica", + "America/Kentucky/Louisville", + "America/Kentucky/Monticello", + "America/Lima", + "America/Louisville", + "America/Montreal", + "America/Nassau", + "America/New_York", + "America/Nipigon", + "America/Panama", + "America/Pangnirtung", + "America/Port-au-Prince", + "America/Porto_Acre", + "America/Rio_Branco", + "America/Thunder_Bay", + "America/Toronto", + "Brazil/Acre", + "Canada/Eastern", + "Cuba", + "EST", + "EST5EDT", + "Etc/GMT+5", + "IET", + "Jamaica", + "SystemV/EST5", + "SystemV/EST5EDT", + "US/East-Indiana", + "US/Eastern", + "US/Michigan", + "America/Caracas", + "America/Anguilla", + "America/Antigua", + "America/Aruba", + "America/Asuncion", + "America/Barbados", + "America/Blanc-Sablon", + "America/Boa_Vista", + "America/Campo_Grande", + "America/Cuiaba", + "America/Curacao", + "America/Dominica", + "America/Glace_Bay", + "America/Goose_Bay", + "America/Grenada", + "America/Guadeloupe", + "America/Guyana", + "America/Halifax", + "America/La_Paz", + "America/Manaus", + "America/Martinique", + "America/Moncton", + "America/Montserrat", + "America/Port_of_Spain", + "America/Porto_Velho", + "America/Puerto_Rico", + "America/Santiago", + "America/Santo_Domingo", + "America/St_Kitts", + "America/St_Lucia", + "America/St_Thomas", + "America/St_Vincent", + "America/Thule", + "America/Tortola", + "America/Virgin", + "Antarctica/Palmer", + "Atlantic/Bermuda", + "Atlantic/Stanley", + "Brazil/West", + "Canada/Atlantic", + "Chile/Continental", + "Etc/GMT+4", + "PRT", + "SystemV/AST4", + "SystemV/AST4ADT", + "America/St_Johns", + "CNT", + "Canada/Newfoundland", + "AGT", + "America/Araguaina", + "America/Argentina/Buenos_Aires", + "America/Argentina/Catamarca", + "America/Argentina/ComodRivadavia", + "America/Argentina/Cordoba", + "America/Argentina/Jujuy", + "America/Argentina/La_Rioja", + "America/Argentina/Mendoza", + "America/Argentina/Rio_Gallegos", + "America/Argentina/San_Juan", + "America/Argentina/Tucuman", + "America/Argentina/Ushuaia", + "America/Bahia", + "America/Belem", + "America/Buenos_Aires", + "America/Catamarca", + "America/Cayenne", + "America/Cordoba", + "America/Fortaleza", + "America/Godthab", + "America/Jujuy", + "America/Maceio", + "America/Mendoza", + "America/Miquelon", + "America/Montevideo", + "America/Paramaribo", + "America/Recife", + "America/Rosario", + "America/Sao_Paulo", + "Antarctica/Rothera", + "BET", + "Brazil/East", + "Etc/GMT+3", + "America/Noronha", + "Atlantic/South_Georgia", + "Brazil/DeNoronha", + "Etc/GMT+2", + "America/Scoresbysund", + "Atlantic/Azores", + "Atlantic/Cape_Verde", + "Etc/GMT+1", + "Africa/Abidjan", + "Africa/Accra", + "Africa/Bamako", + "Africa/Banjul", + "Africa/Bissau", + "Africa/Casablanca", + "Africa/Conakry", + "Africa/Dakar", + "Africa/El_Aaiun", + "Africa/Freetown", + "Africa/Lome", + "Africa/Monrovia", + "Africa/Nouakchott", + "Africa/Ouagadougou", + "Africa/Sao_Tome", + "Africa/Timbuktu", + "America/Danmarkshavn", + "Atlantic/Canary", + "Atlantic/Faeroe", + "Atlantic/Madeira", + "Atlantic/Reykjavik", + "Atlantic/St_Helena", + "Eire", + "Etc/GMT", + "Etc/GMT+0", + "Etc/GMT-0", + "Etc/GMT0", + "Etc/Greenwich", + "Etc/UCT", + "Etc/UTC", + "Etc/Universal", + "Etc/Zulu", + "Europe/Belfast", + "Europe/Dublin", + "Europe/Guernsey", + "Europe/Isle_of_Man", + "Europe/Jersey", + "Europe/Lisbon", + "Europe/London", + "GB", + "GB-Eire", + "GMT", + "GMT0", + "Greenwich", + "Iceland", + "Portugal", + "UCT", + "UTC", + "Universal", + "WET", + "Zulu", + "Africa/Algiers", + "Africa/Bangui", + "Africa/Brazzaville", + "Africa/Ceuta", + "Africa/Douala", + "Africa/Kinshasa", + "Africa/Lagos", + "Africa/Libreville", + "Africa/Luanda", + "Africa/Malabo", + "Africa/Ndjamena", + "Africa/Niamey", + "Africa/Porto-Novo", + "Africa/Tunis", + "Africa/Windhoek", + "Arctic/Longyearbyen", + "Atlantic/Jan_Mayen", + "CET", + "ECT", + "Etc/GMT-1", + "Europe/Amsterdam", + "Europe/Andorra", + "Europe/Belgrade", + "Europe/Berlin", + "Europe/Bratislava", + "Europe/Brussels", + "Europe/Budapest", + "Europe/Copenhagen", + "Europe/Gibraltar", + "Europe/Ljubljana", + "Europe/Luxembourg", + "Europe/Madrid", + "Europe/Malta", + "Europe/Monaco", + "Europe/Oslo", + "Europe/Paris", + "Europe/Podgorica", + "Europe/Prague", + "Europe/Rome", + "Europe/San_Marino", + "Europe/Sarajevo", + "Europe/Skopje", + "Europe/Stockholm", + "Europe/Tirane", + "Europe/Vaduz", + "Europe/Vatican", + "Europe/Vienna", + "Europe/Warsaw", + "Europe/Zagreb", + "Europe/Zurich", + "MET", + "Poland", + "ART", + "Africa/Blantyre", + "Africa/Bujumbura", + "Africa/Cairo", + "Africa/Gaborone", + "Africa/Harare", + "Africa/Johannesburg", + "Africa/Kigali", + "Africa/Lubumbashi", + "Africa/Lusaka", + "Africa/Maputo", + "Africa/Maseru", + "Africa/Mbabane", + "Africa/Tripoli", + "Asia/Amman", + "Asia/Beirut", + "Asia/Damascus", + "Asia/Gaza", + "Asia/Istanbul", + "Asia/Jerusalem", + "Asia/Nicosia", + "Asia/Tel_Aviv", + "CAT", + "EET", + "Egypt", + "Etc/GMT-2", + "Europe/Athens", + "Europe/Bucharest", + "Europe/Chisinau", + "Europe/Helsinki", + "Europe/Istanbul", + "Europe/Kaliningrad", + "Europe/Kiev", + "Europe/Mariehamn", + "Europe/Minsk", + "Europe/Nicosia", + "Europe/Riga", + "Europe/Simferopol", + "Europe/Sofia", + "Europe/Tallinn", + "Europe/Tiraspol", + "Europe/Uzhgorod", + "Europe/Vilnius", + "Europe/Zaporozhye", + "Israel", + "Libya", + "Turkey", + "Africa/Addis_Ababa", + "Africa/Asmera", + "Africa/Dar_es_Salaam", + "Africa/Djibouti", + "Africa/Kampala", + "Africa/Khartoum", + "Africa/Mogadishu", + "Africa/Nairobi", + "Antarctica/Syowa", + "Asia/Aden", + "Asia/Baghdad", + "Asia/Bahrain", + "Asia/Kuwait", + "Asia/Qatar", + "Asia/Riyadh", + "EAT", + "Etc/GMT-3", + "Europe/Moscow", + "Europe/Volgograd", + "Indian/Antananarivo", + "Indian/Comoro", + "Indian/Mayotte", + "W-SU", + "Asia/Riyadh87", + "Asia/Riyadh88", + "Asia/Riyadh89", + "Mideast/Riyadh87", + "Mideast/Riyadh88", + "Mideast/Riyadh89", + "Asia/Tehran", + "Iran", + "Asia/Baku", + "Asia/Dubai", + "Asia/Muscat", + "Asia/Tbilisi", + "Asia/Yerevan", + "Etc/GMT-4", + "Europe/Samara", + "Indian/Mahe", + "Indian/Mauritius", + "Indian/Reunion", + "NET", + "Asia/Kabul", + "Asia/Aqtau", + "Asia/Aqtobe", + "Asia/Ashgabat", + "Asia/Ashkhabad", + "Asia/Dushanbe", + "Asia/Karachi", + "Asia/Oral", + "Asia/Samarkand", + "Asia/Tashkent", + "Asia/Yekaterinburg", + "Etc/GMT-5", + "Indian/Kerguelen", + "Indian/Maldives", + "PLT", + "Asia/Kolkata", + "Asia/Calcutta", + "Asia/Colombo", + "IST", + "Asia/Katmandu", + "Antarctica/Mawson", + "Antarctica/Vostok", + "Asia/Almaty", + "Asia/Bishkek", + "Asia/Dacca", + "Asia/Dhaka", + "Asia/Novosibirsk", + "Asia/Omsk", + "Asia/Qyzylorda", + "Asia/Thimbu", + "Asia/Thimphu", + "BST", + "Etc/GMT-6", + "Indian/Chagos", + "Asia/Rangoon", + "Indian/Cocos", + "Antarctica/Davis", + "Asia/Bangkok", + "Asia/Hovd", + "Asia/Jakarta", + "Asia/Krasnoyarsk", + "Asia/Phnom_Penh", + "Asia/Pontianak", + "Asia/Saigon", + "Asia/Vientiane", + "Etc/GMT-7", + "Indian/Christmas", + "VST", + "Antarctica/Casey", + "Asia/Brunei", + "Asia/Chongqing", + "Asia/Harbin", + "Asia/Hong_Kong", + "Asia/Irkutsk", + "Asia/Kashgar", + "Asia/Kuala_Lumpur", + "Asia/Kuching", + "Asia/Macao", + "Asia/Makassar", + "Asia/Manila", + "Asia/Shanghai", + "Asia/Singapore", + "Asia/Taipei", + "Asia/Ujung_Pandang", + "Asia/Ulaanbaatar", + "Asia/Ulan_Bator", + "Asia/Urumqi", + "Australia/Perth", + "Australia/West", + "CTT", + "Etc/GMT-8", + "PRC", + "Singapore", + "Asia/Choibalsan", + "Asia/Dili", + "Asia/Jayapura", + "Asia/Pyongyang", + "Asia/Seoul", + "Asia/Tokyo", + "Asia/Yakutsk", + "Etc/GMT-9", + "JST", + "Japan", + "Pacific/Palau", + "ROK", + "ACT", + "Australia/Adelaide", + "Australia/Broken_Hill", + "Australia/Darwin", + "Australia/North", + "Australia/South", + "Australia/Yancowinna", + "AET", + "Antarctica/DumontDUrville", + "Asia/Sakhalin", + "Asia/Vladivostok", + "Australia/ACT", + "Australia/Brisbane", + "Australia/Canberra", + "Australia/Currie", + "Australia/Hobart", + "Australia/Lindeman", + "Australia/Melbourne", + "Australia/NSW", + "Australia/Queensland", + "Australia/Sydney", + "Australia/Tasmania", + "Australia/Victoria", + "Etc/GMT-10", + "Pacific/Guam", + "Pacific/Port_Moresby", + "Pacific/Saipan", + "Pacific/Truk", + "Pacific/Yap", + "Australia/LHI", + "Australia/Lord_Howe", + "Asia/Magadan", + "Etc/GMT-11", + "Pacific/Efate", + "Pacific/Guadalcanal", + "Pacific/Kosrae", + "Pacific/Noumea", + "Pacific/Ponape", + "SST", + "Pacific/Norfolk", + "Antarctica/McMurdo", + "Antarctica/South_Pole", + "Asia/Anadyr", + "Asia/Kamchatka", + "Etc/GMT-12", + "Kwajalein", + "NST", + "NZ", + "Pacific/Auckland", + "Pacific/Fiji", + "Pacific/Funafuti", + "Pacific/Kwajalein", + "Pacific/Majuro", + "Pacific/Nauru", + "Pacific/Tarawa", + "Pacific/Wake", + "Pacific/Wallis", + "NZ-CHAT", + "Pacific/Chatham", + "Etc/GMT-13", + "Pacific/Enderbury", + "Pacific/Tongatapu", + "Etc/GMT-14", + "Pacific/Kiritimati", + "America/Punta_Arenas", + "Asia/Yangon", + "Asia/Macau", + "Pacific/Chuuk", + "Pacific/Pohnpei", + "Atlantic/Faroe" + ] + } + }, + "responses": {}, + "securityDefinitions": { + "oauth2-auth": { + "type": "oauth2", + "flow": "accessCode", + "tokenUrl": "https://accounts.zoho.com/oauth/v2/token", + "scopes": { + "ZohoCalendar.calendar.ALL": "ZohoCalendar.calendar.ALL", + "ZohoCalendar.event.ALL": "ZohoCalendar.event.ALL", + "ZohoCalendar.settings.ALL": "ZohoCalendar.settings.ALL", + "ZohoCalendar.search.READ": "ZohoCalendar.search.READ" + }, + "authorizationUrl": "https://accounts.zoho.com/oauth/v2/auth" + } + }, + "security": [ + { + "oauth2-auth": [ + "ZohoCalendar.calendar.ALL", + "ZohoCalendar.event.ALL", + "ZohoCalendar.settings.ALL", + "ZohoCalendar.search.READ" + ] + } + ], + "tags": [], + "x-ms-connector-metadata": [ + { + "propertyName": "Website", + "propertyValue": "https://www.zoho.com/calendar/" + }, + { + "propertyName": "Privacy policy", + "propertyValue": "https://www.zoho.com/privacy.html" + }, + { + "propertyName": "Categories", + "propertyValue": "Collaboration;Productivity" + } + ], + "x-ms-openai-manifest": { + "humanName": "Zoho Calendar", + "contactEmail": "support@zohocalendar.com", + "legalUrl": "https://www.zoho.com/terms.html", + "modelDescription": "This is the Zoho Calendar plugin that brings back calendar details, events, and notifications from Zoho Calendar." + } } diff --git a/certified-connectors/Zoho Calendar/apiProperties.json b/certified-connectors/Zoho Calendar/apiProperties.json index 01b923f4e4..122f7f914e 100644 --- a/certified-connectors/Zoho Calendar/apiProperties.json +++ b/certified-connectors/Zoho Calendar/apiProperties.json @@ -152,6 +152,16 @@ "Get_Calendar_Details" ] } + }, + { + "templateId": "setheader", + "title": "Set Useragent", + "parameters": { + "x-ms-apimTemplateParameter.name": "user-agent", + "x-ms-apimTemplateParameter.value": "MS PowerAutomate", + "x-ms-apimTemplateParameter.existsAction": "override", + "x-ms-apimTemplate-policySection": "Request" + } } ], "publisher": "Zoho Mail", diff --git a/certified-connectors/Zoho Calendar/readme.md b/certified-connectors/Zoho Calendar/readme.md index 98cd584980..c389bf9512 100644 --- a/certified-connectors/Zoho Calendar/readme.md +++ b/certified-connectors/Zoho Calendar/readme.md @@ -12,19 +12,33 @@ A verified Zoho Calendar account. Click [here](https://zoho.com/calendar) to cre The connector supports the following operations: +### Get calendar list + +Gets the list of all calendars with the calendar UID, name, and timezone. + +### Get calendar details + +Retrieves the details of a particular calendar using the Calendar UID such as its name and timezone + +### Get Event list + +Gets the list of all the events with Event UID, Calendar UID, Title, start date, end date, between the specified date range in yyyy-MM-ddTHH:mm:sszzz format. + ### Create new event Adds a new event to the user's calendar. ### Delete event + Deletes an event from the user's calendar. ### Get event -Gets the details of a particular event from a specified calendar of the user. + +Gets the details of a particular event such as the Event Title, start date, end date, etc., based on the calendar UID and event UID ### Search Events -Gets the list of events across all calendars. +Gets the list of events from the specified calendar UID based on the date range in yyyy-MM-ddTHH:mm:sszzz format. ### Update Event diff --git a/certified-connectors/Zoho Calendar/script.csx b/certified-connectors/Zoho Calendar/script.csx index cfe21387d9..8b342ca8ae 100644 --- a/certified-connectors/Zoho Calendar/script.csx +++ b/certified-connectors/Zoho Calendar/script.csx @@ -2,10 +2,16 @@ public override async Task < HttpResponseMessage > ExecuteAsync() { if (this.Context.OperationId == "New_Event") { try { - JObject eventData = JObject.Parse(await this.Context.Request.Content.ReadAsStringAsync()); + JsonSerializerSettings settings = new JsonSerializerSettings + { + DateParseHandling = DateParseHandling.None + }; + + JObject eventData = (JObject)JsonConvert.DeserializeObject(await this.Context.Request.Content.ReadAsStringAsync(),settings); HttpRequestMessage request = this.Context.Request; var uriBuilder = new UriBuilder(this.Context.Request.RequestUri); uriBuilder.Query = ""; + bool isAllDay = (eventData["isallday"] != null) ? (bool) eventData["isallday"] : false; eventData["dateandtime"] = getConvertedDateTime((JObject) eventData["dateandtime"], isAllDay); request.RequestUri = uriBuilder.Uri; @@ -35,7 +41,7 @@ if (events.Count > 1 || eventObj.ContainsKey("rrule")) { return getErrorMessage(HttpStatusCode.BadRequest, "Cannot delete this event because it is a recurring event."); } - + string etag = (string) eventObj["etag"]; request.Headers.TryAddWithoutValidation("etag", etag); } else { @@ -47,7 +53,16 @@ HttpRequestMessage request = this.Context.Request; var query = System.Web.HttpUtility.ParseQueryString(request.RequestUri.Query); var uriBuilder = new UriBuilder(this.Context.Request.RequestUri); - uriBuilder.Query = ""; + query.Remove("cuid"); + bool hasTimeZone = !String.IsNullOrEmpty("timezone"); + JObject rangeObj = new JObject(); + rangeObj["start"] = getConvertedTime(query["start"], DTFormat.Any, true); + rangeObj["end"] = getConvertedTime(query["end"], DTFormat.Any, true); + query.Remove("start"); + query.Remove("end"); + query["range"] = rangeObj.ToString(); + uriBuilder.Query = query.ToString(); + this.Context.Request.RequestUri = uriBuilder.Uri; HttpResponseMessage response = await this.Context.SendAsync(request, this.CancellationToken).ConfigureAwait(continueOnCapturedContext: false); return response; @@ -76,9 +91,10 @@ var query = System.Web.HttpUtility.ParseQueryString(request.RequestUri.Query); var uriBuilder = new UriBuilder(this.Context.Request.RequestUri); query.Remove("cuid"); - query["start"] = getConvertedTime(query["start"], false, true); + DTFormat timeFormat = DTFormat.Any; + query["start"] = getConvertedTime(query["start"], timeFormat, true); if (query["end"] != null && !String.IsNullOrEmpty(query["end"])) { - query["end"] = getConvertedTime(query["end"], false, true); + query["end"] = getConvertedTime(query["end"], timeFormat, true); } uriBuilder.Query = query.ToString(); this.Context.Request.RequestUri = uriBuilder.Uri; @@ -97,7 +113,12 @@ request.RequestUri = uriBuilder.Uri; HttpRequestMessage eventRequest = CloneHttpRequest(request, HttpMethod.Get); HttpResponseMessage eventResponseMsg = await this.Context.SendAsync(eventRequest, this.CancellationToken).ConfigureAwait(continueOnCapturedContext: false); - JObject eventData = JObject.Parse(await this.Context.Request.Content.ReadAsStringAsync()); + JsonSerializerSettings settings = new JsonSerializerSettings + { + DateParseHandling = DateParseHandling.None + }; + + JObject eventData = (JObject)JsonConvert.DeserializeObject(await this.Context.Request.Content.ReadAsStringAsync(),settings); string responseString = await eventResponseMsg.Content.ReadAsStringAsync().ConfigureAwait(continueOnCapturedContext: false); JObject eventResp = JObject.Parse(responseString); JArray events = (JArray) eventResp["events"]; @@ -128,23 +149,21 @@ public static JObject getConvertedDateTime(JObject eventData, bool isAllDay) { JObject covertedDateObj = JObject.Parse("{}"); bool hasTimeZone = eventData.ContainsKey("timezone") && !string.IsNullOrEmpty((string) eventData["timezone"]); - covertedDateObj["start"] = getConvertedTime(eventData["start"].Value < string > (), isAllDay, !hasTimeZone); - covertedDateObj["end"] = getConvertedTime(eventData["end"].Value < string > (), isAllDay, !hasTimeZone); + DTFormat dtFormat = (isAllDay)?DTFormat.Only_Date:DTFormat.Date_Time; + covertedDateObj["start"] = getConvertedTime(eventData["start"].Value < string > (), dtFormat, !hasTimeZone); + covertedDateObj["end"] = getConvertedTime(eventData["end"].Value < string > (), dtFormat, !hasTimeZone); if (hasTimeZone) { covertedDateObj["timezone"] = (string) eventData["timezone"]; } return covertedDateObj; } - public static string getConvertedTime(string value, bool isDateFormat, bool isOffsetNeeded) { + public static string getConvertedTime(string value, DTFormat dtFormat, bool isOffsetNeeded) { string outputDTFormat = "yyyyMMddTHHmmss"; string outputDFormat = "yyyyMMdd"; String[] datetimeformatWZ = { "yyyy/MM/dd'T'HH:mm:sszzz", - "yyyy/MM/dd'T'HH:mm:ssZ", "yyyy-MM-dd'T'HH:mm:sszzz", - "yyyy-MM-dd'T'HH:mm:ssZ", - "yyyyMMdd'T'HHmmssZ", "yyyyMMdd'T'HHmmsszzz" }; String[] datetimeformat = { @@ -159,31 +178,30 @@ }; DateTime newDate; DateTime convertedDate; - bool hasOffset = false; if (DateTime.TryParseExact(value, datetimeformat, null, System.Globalization.DateTimeStyles.None, out convertedDate)) { - if (isOffsetNeeded) { - newDate = convertedDate.ToUniversalTime(); + newDate = convertedDate; + } + else if (DateTimeOffset.TryParseExact(value, datetimeformatWZ, null, System.Globalization.DateTimeStyles.None, out DateTimeOffset convertedDateOffset)) { + if(dtFormat == DTFormat.Only_Date){ + return convertedDateOffset.ToString(outputDFormat); + } else if(dtFormat == DTFormat.Any){ + newDate = convertedDateOffset.ToUniversalTime().DateTime; } else { - newDate = convertedDate; + return convertedDateOffset.ToString(outputDTFormat+"zzz").Replace(":",""); } - } else if (DateTime.TryParseExact(value, datetimeformatWZ, null, System.Globalization.DateTimeStyles.None, out convertedDate)) { - newDate = convertedDate.ToUniversalTime(); - hasOffset = true; + } else if (DateTime.TryParseExact(value, dateformat, null, System.Globalization.DateTimeStyles.None, out convertedDate)) { + newDate = convertedDate; + } else if (DateTime.TryParse(value, out convertedDate)) { - newDate = convertedDate.ToUniversalTime(); - hasOffset = true; - } else if (DateTime.TryParseExact(value, dateformat, null, System.Globalization.DateTimeStyles.None, out convertedDate)) { newDate = convertedDate; - } else if (long.TryParse(value, out long timeinmillis)) { - newDate = DateTimeOffset.FromUnixTimeMilliseconds(timeinmillis).UtcDateTime; - hasOffset = true; + } else { throw new Exception("Invalid_Date"); } - if (isDateFormat) { + if (dtFormat == DTFormat.Only_Date) { return newDate.ToString(outputDFormat); - } else if (isOffsetNeeded || hasOffset) { + } else if (isOffsetNeeded ) { return newDate.ToString(outputDTFormat + "Z"); } else { return newDate.ToString(outputDTFormat); @@ -234,4 +252,9 @@ errorResponse.Content = CreateJsonContent(errorObj.ToString()); return errorResponse; } + public enum DTFormat { + Only_Date, + Date_Time, + Any + } } \ No newline at end of file