You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2026-05-22 10:05:29 +02:00
3.4 KiB
3.4 KiB
sidebar_position
| sidebar_position |
|---|
| 4 |
Create event
Creates a new event
Function CreateEvent(Val Token, Val Calendar, Val EventDescription) Export
| Parameter | CLI option | Type | Description |
|---|---|---|---|
| Token | --token | String | Token |
| Calendar | --calendar | String | Calendar ID |
| EventDescription | --props | Map Of KeyAndValue | Event description |
Returns: String, Arbitrary, HTTPResponse, BinaryData, Undefined - Google server response
CurrentDate = OPI_Tools.GetCurrentDate();
Token = "ya29.a0AcM612xw6IRwwkQIOEhizd2pJ6LLI4UAhdhxmXDGEzYkcfUPrLYgDDwbsSi5iQdc78WPs_1_Qor5KipuV6mAIvr6z-AKzrBaMT4erIR5T...";
Calendar = "e8a267e4a6629e0ef3f8a08ca54f52e2b031d3c40bd27d2866c2ed083c6353ec@group.calendar.google.com";
Name = "New event";
Description = "TestEventDescription";
Hour = 3600;
Image1 = "https://openyellow.neocities.org/test_data/picture.jpg"; // URL, Binary or Path to file
Image2 = "https://openyellow.neocities.org/test_data/picture2.jpg"; // URL, Binary or Path to file
Attachments = New Map;
Attachments.Insert("Image1", Image1);
Attachments.Insert("Image2", Image2);
EventDescription = New Map;
EventDescription.Insert("Description" , Description);
EventDescription.Insert("Title" , Name);
EventDescription.Insert("Venue" , "InOffice");
EventDescription.Insert("StartDate" , CurrentDate);
EventDescription.Insert("EndDate" , EventDescription["StartDate"] + Hour);
EventDescription.Insert("ArrayOfAttachmentURLs" , Attachments);
EventDescription.Insert("SendNotifications" , True);
Result = OPI_GoogleCalendar.CreateEvent(Token, Calendar, EventDescription);
oint gcalendar CreateEvent --token %token% --calendar %calendar% --props %props%
{
"kind": "calendar#event",
"etag": "\"3456657308348000\"",
"id": "2m8dvff37scrs418csuqd9c0l0",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=Mm04ZHZmZjM3c2NyczQxOGNzdXFkOWMwbDAgYjA5MTYxMDAyM2EyOWM0NzY5ZGI3NjUyZmNiN2E1YTMyNTRmNGQ2NjdiZWJkNTBmOTZmMGY0NWY2NTE3NzIzYkBn",
"created": "2024-10-07T19:17:34Z",
"updated": "2024-10-07T19:17:34.174Z",
"summary": "New event",
"description": "TestEventDescription",
"location": "InOffice",
"creator": {
"email": "bayselonarrend@gmail.com"
},
"organizer": {
"email": "b091610023a29c4769db7652fcb7a5a3254f4d667bebd50f96f0f45f6517723b@group.calendar.google.com",
"displayName": "TestCalendar",
"self": true
},
"start": {
"dateTime": "2024-10-08T01:17:34+03:00",
"timeZone": "Europe/Moscow"
},
"end": {
"dateTime": "2024-10-08T02:17:34+03:00",
"timeZone": "Europe/Moscow"
},
"iCalUID": "2m8dvff37scrs418csuqd9c0l0@google.com",
"sequence": 0,
"reminders": {
"useDefault": true
},
"attachments": [
{
"fileUrl": "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/picture.jpg",
"title": "Image1",
"iconLink": ""
},
{
"fileUrl": "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/picture2.jpg",
"title": "Image2",
"iconLink": ""
}
],
"eventType": "default"
}