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_BDTgQbn9c5rXhPK3FCakms_7oKkdIWE1CCQFnSPftb2RxvloVqnYOcnsAKhXrD0Gq8Tz2Kgn5IBXG5E25uksZfvvTtXob-jFcuj_9LZYs9La4HrcFk766...";
Calendar = "a9168079abee0b7314a77e16ec7ada0ae393cdd389a6f4a8d3f4501aa958f8e9@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
oint gcalendar CreateEvent \
--token "***" \
--calendar "73c36eb1ab0dd34c3c2f298af8fdac687154aa19a316b297b75bb9d76c68ee39@group.calendar.google.com" \
--props "{'Description':'TestEventDescription','Title':'New event','Venue':'InOffice','StartDate':'09/15/2025 22:29:51','EndDate':'09/15/2025 23:29:51','ArrayOfAttachmentURLs':{'Image1':'https://hut.openintegrations.dev/test_data/picture.jpg','Image2':'https://hut.openintegrations.dev/test_data/picture2.jpg'},'SendNotifications':true}"
oint gcalendar CreateEvent ^
--token "***" ^
--calendar "73c36eb1ab0dd34c3c2f298af8fdac687154aa19a316b297b75bb9d76c68ee39@group.calendar.google.com" ^
--props "{'Description':'TestEventDescription','Title':'New event','Venue':'InOffice','StartDate':'09/15/2025 22:29:51','EndDate':'09/15/2025 23:29:51','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": "\"3515950789474558\"",
"id": "mevv7hielimqt2v59r2nt6fh6k",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=bWV2djdoaWVsaW1xdDJ2NTlyMm50NmZoNmsgNzNjMzZlYjFhYjBkZDM0YzNjMmYyOThhZjhmZGFjNjg3MTU0YWExOWEzMTZiMjk3Yjc1YmI5ZDc2YzY4ZWUzOUBn",
"created": "2025-09-15T22:29:54Z",
"updated": "2025-09-15T22:29:54.737Z",
"summary": "New event",
"description": "TestEventDescription",
"location": "InOffice",
"creator": {
"email": "bayselonarrend@gmail.com"
},
"organizer": {
"email": "73c36eb1ab0dd34c3c2f298af8fdac687154aa19a316b297b75bb9d76c68ee39@group.calendar.google.com",
"displayName": "TestCalendar",
"self": true
},
"start": {
"dateTime": "2025-09-15T22:29:51+00:00",
"timeZone": "Europe/Moscow"
},
"end": {
"dateTime": "2025-09-15T23:29:51+00:00",
"timeZone": "Europe/Moscow"
},
"iCalUID": "mevv7hielimqt2v59r2nt6fh6k@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"
}