Create calendar event
Creates a new calendar event
Function CreateCalendarEvent(Val URL, Val EventDescription, Val Token = "") Export
Parameter | CLI option | Type | Required | Description |
---|---|---|---|---|
URL | --url | String | ✔ | URL of webhook or a Bitrix24 domain, when token used |
EventDescription | --fields | Structure Of KeyAndValue | ✔ | Event description. See GetCalendarEventsStructure |
Token | --token | String | ✖ | Access token, when app auth method used |
Returns: Map Of KeyAndValue - serialized JSON of answer from Bitrix24 API
tip
Method at API documentation: calendar.event.add
1C:Enterprise/OneScript code example
URL = "https://b24-ar17wx.bitrix24.by/rest/1/h0m...";
CalendarID = "362";
Tomorrow = OPI_Tools.GetCurrentDate() + 86400;
Hour = 3600;
EventStucture = New Structure;
EventStucture.Insert("type" , "user");
EventStucture.Insert("ownerId" , 1);
EventStucture.Insert("from" , XMLString(Tomorrow));
EventStucture.Insert("to" , XMLString(Tomorrow + Hour));
EventStucture.Insert("section" , CalendarID);
EventStucture.Insert("name" , "New event");
EventStucture.Insert("skip_time" , "N");
EventStucture.Insert("timezone_from", "Europe/Minsk");
EventStucture.Insert("timezone_to" , "Europe/Minsk");
EventStucture.Insert("description" , "Event description");
EventStucture.Insert("color" , "%23000000>");
EventStucture.Insert("text_color" , "%23FFFFFF");
EventStucture.Insert("accessibility", "quest");
EventStucture.Insert("importance" , "normal");
EventStucture.Insert("private_event", "Y");
RepeatabilityStructure = New Structure;
RepeatabilityStructure.Insert("FREQ" , "DAILY");
RepeatabilityStructure.Insert("COUNT" , 3);
RepeatabilityStructure.Insert("INTERVAL", 10);
DaysArray = New Array;
DaysArray.Add("SA");
DaysArray.Add("MO");
RepeatabilityStructure.Insert("BYDAY" , DaysArray);
RepeatabilityStructure.Insert("UNTIL" , XMLString(Tomorrow + Hour * 24 * 10));
EventStucture.Insert("rrule" , RepeatabilityStructure);
EventStucture.Insert("is_meeting", "Y");
EventStucture.Insert("location" , "Office");
RemindersArray = New Array;
ReminderStructure = New Structure;
ReminderStructure.Insert("type" , "day");
ReminderStructure.Insert("count", 1);
RemindersArray.Add(ReminderStructure);
EventStucture.Insert("remind" , RemindersArray);
EventStucture.Insert("attendees", StrSplit("1,10", ","));
EventStucture.Insert("host" , 1);
MeetingStructure = New Structure;
MeetingStructure.Insert("notify" , "Y");
MeetingStructure.Insert("reinvite" , "Y");
MeetingStructure.Insert("allow_invite", "N");
MeetingStructure.Insert("hide_guests" , "N");
EventStucture.Insert("meeting", MeetingStructure);
Result = OPI_Bitrix24.CreateCalendarEvent(URL, EventStucture);
URL = "b24-ar17wx.bitrix24.by";
Token = "8536b467006e9f06006b12e400000001000...";
CalendarID = "364";
EventStucture.Insert("section", CalendarID);
Result = OPI_Bitrix24.CreateCalendarEvent(URL, EventStucture, Token);
- Bash
- CMD/Bat
# JSON data can also be passed as a path to a .json file
oint bitrix24 CreateCalendarEvent \
--url "b24-ar17wx.bitrix24.by" \
--fields "{'type':'user','ownerId':1,'from':'2025-02-19T13:44:02.182957','to':'2025-02-19T14:44:02.182957','section':380,'name':'New event','skip_time':'N','timezone_from':'Europe/Minsk','timezone_to':'Europe/Minsk','description':'Event description','color':'%23000000>','text_color':'%23FFFFFF','accessibility':'busy','importance':'high','private_event':'N','rrule':{'FREQ':'DAILY','COUNT':3,'INTERVAL':10,'BYDAY':['SA','MO'],'UNTIL':'2025-03-01T13:44:02.182957'},'is_meeting':'Y','location':'Office','remind':[{'type':'day','count':1}],'attendees':['1','10'],'host':1,'meeting':{'notify':'Y','reinvite':'Y','allow_invite':'N','hide_guests':'N'}}" \
--token "***"
:: JSON data can also be passed as a path to a .json file
oint bitrix24 CreateCalendarEvent ^
--url "b24-ar17wx.bitrix24.by" ^
--fields "{'type':'user','ownerId':1,'from':'2025-02-19T13:44:02.182957','to':'2025-02-19T14:44:02.182957','section':380,'name':'New event','skip_time':'N','timezone_from':'Europe/Minsk','timezone_to':'Europe/Minsk','description':'Event description','color':'%23000000>','text_color':'%23FFFFFF','accessibility':'busy','importance':'high','private_event':'N','rrule':{'FREQ':'DAILY','COUNT':3,'INTERVAL':10,'BYDAY':['SA','MO'],'UNTIL':'2025-03-01T13:44:02.182957'},'is_meeting':'Y','location':'Office','remind':[{'type':'day','count':1}],'attendees':['1','10'],'host':1,'meeting':{'notify':'Y','reinvite':'Y','allow_invite':'N','hide_guests':'N'}}" ^
--token "***"
Result
{
"result": 306,
"time": {
"start": 1739051124.1171,
"finish": 1739051124.33063,
"duration": 0.213531017303467,
"processing": 0.188530921936035,
"date_start": "2025-02-09T00:45:24+03:00",
"date_finish": "2025-02-09T00:45:24+03:00",
"operating_reset_at": 1739051724,
"operating": 0.18851113319397
}
}