Create event
Creates a new event
- Parameters
- Advanced call ?
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
| Parameter | Description |
|---|---|
| proxy | InternetProxy or a structure with fields Protocol, Host, Port, User, Password, UseOSAuthentication |
| timeout | Request execution timeout |
| adv_response | Formats the response as a complete HTTP structure with fields code, body, and headers |
| retries | Number of HTTP request send attempts on 5** status codes or internal client errors |
| dontwait | Creates a background job and returns its data (for 1C and OneScript only) |
1C:Enterprise/OneScript code example
CurrentDate = OPI_Tools.GetCurrentDate();
Token = "ya29.a0ATi6K2sWW_31WLH0d9aK0qk0HJ-UfyvZDcLeBbF5bLU7QH09Bx2pXAupIw40USQVaxXqsovItVSt9swWuPdBDSA0eFaVPE0CbaU2OLQlyrnITI1VVXgZ_Gx2R...";
Calendar = "f70efec034ef36b040f12b5d8938e54fc399d73cd37b8e765bdd86ebc4a67e4a@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 "2e2a088af05c1d88f3793172eae35d956b6303f5c1504210c14594fd60e13212@group.calendar.google.com" \
--props "{'Description':'TestEventDescription','Title':'New event','Venue':'InOffice','StartDate':'05/26/2026 14:03:05','EndDate':'05/26/2026 15:03:05','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 "2e2a088af05c1d88f3793172eae35d956b6303f5c1504210c14594fd60e13212@group.calendar.google.com" ^
--props "{'Description':'TestEventDescription','Title':'New event','Venue':'InOffice','StartDate':'05/26/2026 14:03:05','EndDate':'05/26/2026 15:03:05','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": "\"3559608372255934\"",
"id": "1fbgednhburavkoh3qor3mi30c",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=MWZiZ2VkbmhidXJhdmtvaDNxb3IzbWkzMGMgMmUyYTA4OGFmMDVjMWQ4OG...",
"created": "2026-05-26T14:03:06Z",
"updated": "2026-05-26T14:03:06.127Z",
"summary": "New event",
"description": "TestEventDescription",
"location": "InOffice",
"creator": {
"email": "bayselonarrend@gmail.com"
},
"organizer": {
"email": "2e2a088af05c1d88f3793172eae35d956b6303f5c1504210c14594fd60e13212@group.calendar.google.com",
"displayName": "TestCalendar",
"self": true
},
"start": {
"dateTime": "2026-05-26T14:03:05+00:00",
"timeZone": "Europe/Moscow"
},
"end": {
"dateTime": "2026-05-26T15:03:05+00:00",
"timeZone": "Europe/Moscow"
},
"iCalUID": "1fbgednhburavkoh3qor3mi30c@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"
}