Skip to main content

Create event

Creates a new event

Function CreateEvent(Val Token, Val Calendar, Val EventDescription) Export

ParameterCLI optionTypeRequiredDescription
Token--tokenStringToken
Calendar--calendarStringCalendar ID
EventDescription--propsMap Of KeyAndValueEvent description

Returns: String, Arbitrary, HTTPResponse, BinaryData, Undefined - Google server response


1C:Enterprise/OneScript code example
    CurrentDate = OPI_Tools.GetCurrentDate();
Token = "ya29.a0ATi6K2tVhkOEu91I_FKDEZ7_olNcPRKrwKbGh7GiFIzwDZjaTNm46ErGj-Lju2am1aAUurgQyVnv0f3G4L7keHSXYNhuCPGvTvzjRdPQJNz_0LzKWjviK54u4...";
Calendar = "27c0997a94ab1fa7a33cc8e22f5286319a5d71143235f31fcce71adf79941e8a@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);
    # JSON data can also be passed as a path to a .json file

oint gcalendar CreateEvent \
--token "***" \
--calendar "313c8f09201e93c0d539b3ad93aac84472eab7926cee7dbf3beb6ae5fc9b4fa4@group.calendar.google.com" \
--props "{'Description':'TestEventDescription','Title':'New event','Venue':'InOffice','StartDate':'10/30/2025 8:02:07 PM','EndDate':'10/30/2025 9:02:07 PM','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": "\"3523822026591486\"",
"id": "l6kkhcjgt4n0a3qdonan09tv30",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=bDZra2hjamd0NG4wYTNxZG9uYW4wOXR2MzAgZjcwZWZlYzAzNGVmMzZiMDQwZjEyYjVkODkzOGU1NGZjMzk5ZDczY2QzN2I4ZTc2NWJkZDg2ZWJjNGE2N2U0YUBn",
"created": "2025-10-31T11:43:33Z",
"updated": "2025-10-31T11:43:33.295Z",
"summary": "New event",
"description": "TestEventDescription",
"location": "InOffice",
"creator": {
"email": "bayselonarrend@gmail.com"
},
"organizer": {
"email": "f70efec034ef36b040f12b5d8938e54fc399d73cd37b8e765bdd86ebc4a67e4a@group.calendar.google.com",
"displayName": "TestCalendar",
"self": true
},
"start": {
"dateTime": "2025-10-31T11:43:32+00:00",
"timeZone": "Europe/Moscow"
},
"end": {
"dateTime": "2025-10-31T12:43:32+00:00",
"timeZone": "Europe/Moscow"
},
"iCalUID": "l6kkhcjgt4n0a3qdonan09tv30@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"
}