Create event
Creates a new event
Function CreateEvent(Val Token, Val Calendar, Val EventDescription) Export
Parameter | CLI option | Type | Required | 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
1C:Enterprise/OneScript code example
CurrentDate = OPI_Tools.GetCurrentDate();
Token = "ya29.a0AQQ_BDQ_0g6De1s1jLOYbrGQ43QDri_VRPre92E-_aUXJNk52_zY1j3A74665Q7FVMzsgnjqjKN14ljBwB0PlswTyjZlgxcBIDMnuqIbFLhH8Hcxc5NfKIOpS...";
Calendar = "b2a903233c889bf449fe90dc977c5d9b43dc18e7e2116a9507d942aac260bbe5@group.calendar.google.com";
Name = "New event";
Description = "TestEventDescription";
Hour = 3600;
Image1 = "https://hut.openintegrations.dev/test_data/picture.jpg"; // URL, Binary or File path
Image2 = "https://hut.openintegrations.dev/test_data/picture2.jpg"; // URL, Binary or File path
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);
- Bash
- CMD/Bat
# JSON data can also be passed as a path to a .json file
oint gcalendar CreateEvent \
--token "***" \
--calendar "cb2fc2c8adb1cfce485c65a11d46c99dff03108a84fa07d840fc420bf5f61b24@group.calendar.google.com" \
--props "{'Description':'TestEventDescription','Title':'New event','Venue':'InOffice','StartDate':'10/15/2025 09:35:47','EndDate':'10/15/2025 10:35:47','ArrayOfAttachmentURLs':{'Image1':'https://hut.openintegrations.dev/test_data/picture.jpg','Image2':'https://hut.openintegrations.dev/test_data/picture2.jpg'},'SendNotifications':true}"
:: JSON data can also be passed as a path to a .json file
oint gcalendar CreateEvent ^
--token "***" ^
--calendar "cb2fc2c8adb1cfce485c65a11d46c99dff03108a84fa07d840fc420bf5f61b24@group.calendar.google.com" ^
--props "{'Description':'TestEventDescription','Title':'New event','Venue':'InOffice','StartDate':'10/15/2025 09:35:47','EndDate':'10/15/2025 10:35:47','ArrayOfAttachmentURLs':{'Image1':'https://hut.openintegrations.dev/test_data/picture.jpg','Image2':'https://hut.openintegrations.dev/test_data/picture2.jpg'},'SendNotifications':true}"
Result
{
"kind": "calendar#event",
"etag": "\"3521041900752446\"",
"id": "ulf4pckup49gec9msphe981avc",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=dWxmNHBja3VwNDlnZWM5bXNwaGU5ODFhdmMgY2IyZmMyYzhhZGIxY2ZjZTQ4NWM2NWExMWQ0NmM5OWRmZjAzMTA4YTg0ZmEwN2Q4NDBmYzQyMGJmNWY2MWIyNEBn",
"created": "2025-10-15T09:35:50Z",
"updated": "2025-10-15T09:35:50.376Z",
"summary": "New event",
"description": "TestEventDescription",
"location": "InOffice",
"creator": {
"email": "bayselonarrend@gmail.com"
},
"organizer": {
"email": "cb2fc2c8adb1cfce485c65a11d46c99dff03108a84fa07d840fc420bf5f61b24@group.calendar.google.com",
"displayName": "TestCalendar",
"self": true
},
"start": {
"dateTime": "2025-10-15T09:35:47+00:00",
"timeZone": "Europe/Moscow"
},
"end": {
"dateTime": "2025-10-15T10:35:47+00:00",
"timeZone": "Europe/Moscow"
},
"iCalUID": "ulf4pckup49gec9msphe981avc@google.com",
"sequence": 0,
"reminders": {
"useDefault": true
},
"attachments": [
{
"fileUrl": "https://hut.openintegrations.dev/test_data/picture.jpg",
"title": "Image1",
"iconLink": ""
},
{
"fileUrl": "https://hut.openintegrations.dev/test_data/picture2.jpg",
"title": "Image2",
"iconLink": ""
}
],
"eventType": "default"
}