1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-04-13 11:50:53 +02:00

131 lines
4.9 KiB
Plaintext
Raw Normal View History

2024-10-15 10:50:56 +03:00
---
2024-10-15 10:16:04 +03:00
sidebar_position: 4
---
2024-10-15 10:50:56 +03:00
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
2024-10-15 10:16:04 +03:00
# Create event
Creates a new event
`Function CreateEvent(Val Token, Val Calendar, Val EventDescription) Export`
2024-10-15 15:15:47 +03:00
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| Token | --token | String | ✔ | Token |
| Calendar | --calendar | String | ✔ | Calendar ID |
| EventDescription | --props | Map Of KeyAndValue | ✔ | Event description |
2024-10-15 10:16:04 +03:00
Returns: String, Arbitrary, HTTPResponse, BinaryData, Undefined - Google server response
<br/>
2024-10-15 21:15:56 +03:00
```bsl title="1C:Enterprise/OneScript code example"
2024-10-15 10:16:04 +03:00
CurrentDate = OPI_Tools.GetCurrentDate();
2025-02-28 20:58:10 +03:00
Token = "ya29.a0AeXRPp4GQkWyXGKxGjI9dYRUqpQsN6nxl0z83bY6b3s6TwGJ3JznITBBhoHMEDHPF6sCDeNnyAAykBPLfqweLCigrMVX4FL8vcelNFAex...";
2025-02-18 14:08:09 +03:00
Calendar = "37a35af2f6c73c2d5ce643b8f2e2f887893a19f96cbc2df7de6190f86c1bad91@group.calendar.google.com";
2024-10-15 10:16:04 +03:00
Name = "New event";
Description = "TestEventDescription";
Hour = 3600;
Image1 = "https://api.athenaeum.digital/test_data/picture.jpg"; // URL, Binary or Path to file
Image2 = "https://api.athenaeum.digital/test_data/picture2.jpg"; // URL, Binary or Path to file
Attachments = New Map;
Attachments.Insert("Image1", Image1);
Attachments.Insert("Image2", Image2);
EventDescription = New Map;
2025-03-06 20:58:59 +03:00
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);
2024-10-15 10:16:04 +03:00
Result = OPI_GoogleCalendar.CreateEvent(Token, Calendar, EventDescription);
```
2024-10-20 22:36:03 +03:00
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
2024-10-22 08:59:24 +03:00
# JSON data can also be passed as a path to a .json file
2024-10-20 22:36:03 +03:00
oint gcalendar CreateEvent \
2024-10-22 08:59:24 +03:00
--token "***" \
2025-02-19 16:19:57 +03:00
--calendar "176a0877e14a13b440f9fffa1668b9ec5c4c090a05d67ff2a00c17efc81d368e@group.calendar.google.com" \
--props "{'Description':'TestEventDescription','Title':'New event','Venue':'InOffice','StartDate':'2025-02-19T08:59:14.9476558Z','EndDate':'2025-02-19T09:59:14.9476558Z','ArrayOfAttachmentURLs':{'Image1':'https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/picture.jpg','Image2':'https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/picture2.jpg'},'SendNotifications':true}"
2024-10-20 22:36:03 +03:00
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
2024-10-22 08:59:24 +03:00
:: JSON data can also be passed as a path to a .json file
2024-10-20 22:36:03 +03:00
oint gcalendar CreateEvent ^
2024-10-22 08:59:24 +03:00
--token "***" ^
2025-02-19 16:19:57 +03:00
--calendar "176a0877e14a13b440f9fffa1668b9ec5c4c090a05d67ff2a00c17efc81d368e@group.calendar.google.com" ^
--props "{'Description':'TestEventDescription','Title':'New event','Venue':'InOffice','StartDate':'2025-02-19T08:59:14.9476558Z','EndDate':'2025-02-19T09:59:14.9476558Z','ArrayOfAttachmentURLs':{'Image1':'https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/picture.jpg','Image2':'https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/picture2.jpg'},'SendNotifications':true}"
2024-10-20 22:36:03 +03:00
```
</TabItem>
</Tabs>
2024-10-15 10:16:04 +03:00
```json title="Result"
{
"kind": "calendar#event",
"etag": "\"3456908679760000\"",
"id": "7rfbn0fb8nai4i7v4l435tgl1c",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=N3JmYm4wZmI4bmFpNGk3djRsNDM1dGdsMWMgNjA2MTNkNTNjNDY3MGFiZGNlZWMzZTc2OTNjYTQ3NWIwZTg4ZGMxNjc4ZGI3MjEwNTIxMzU2YjQ5NDBhNjE0OEBn",
"created": "2024-10-09T06:12:19Z",
"updated": "2024-10-09T06:12:19.88Z",
"summary": "New event",
"description": "TestEventDescription",
"location": "InOffice",
"creator": {
"email": "bayselonarrend@gmail.com"
},
"organizer": {
"email": "60613d53c4670abdceec3e7693ca475b0e88dc1678db7210521356b4940a6148@group.calendar.google.com",
"displayName": "TestCalendar",
"self": true
},
"start": {
"dateTime": "2024-10-09T12:12:19+03:00",
"timeZone": "Europe/Moscow"
},
"end": {
"dateTime": "2024-10-09T13:12:19+03:00",
"timeZone": "Europe/Moscow"
},
"iCalUID": "7rfbn0fb8nai4i7v4l435tgl1c@google.com",
"sequence": 0,
"reminders": {
"useDefault": true
},
"attachments": [
{
"fileUrl": "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/picture.jpg",
"title": "Image1",
"iconLink": ""
},
{
"fileUrl": "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/picture2.jpg",
"title": "Image2",
"iconLink": ""
}
],
"eventType": "default"
}
```