1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2026-05-22 10:05:29 +02:00
Files
OpenIntegrations/docs/en/md/Google_Calendar/Event-management/Create-event.md
T
Vitaly the Alpaca (bot) 24505af749 Main build (Jenkins)
2024-09-29 00:25:48 +03:00

3.2 KiB

sidebar_position
sidebar_position
4

Create event

Creates a new event

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

Parameter CLI option Type 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


    CurrentDate = OPI_Tools.GetCurrentDate();
    Token       = "ya29.a0AcM612wLdbBK14FR2SE0d3WHabYb8Xtppm0oKCcbVrecgsA-a5DfsgZ29stOw4hu84F_IpHbKTJocsm1WpjLQPBT5MJ6p8D7H1PKa_iT0...";
    Calendar    = "1b68863d126f9c4d9e971c673e25f6601a9622beafbcc10913cd78120c755c6a@group.calendar.google.com";
    Name        = "New event";
    Description = "TestEventDescription";
    Hour        = 3600;

    Image1      = "https://openintegrations.dev/test_data/picture.jpg"; // URL, Binary or Path to file
    Image2      = "https://openintegrations.dev/test_data/picture2.jpg"; // URL, Binary or Path to file
    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);
    
  oint gcalendar CreateEvent --token %token% --calendar %calendar% --props %props%

{
  "eventType": "default",
  "attachments": [
  {
  "iconLink": "",
  "title": "Image2",
  "fileUrl": "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/Media/logo.png?v1"
  },
  {
  "iconLink": "",
  "title": "Image1",
  "fileUrl": "https://opi.neocities.org/assets/images/logo_long-e8fdcca6ff8b32e679ea49a1ccdd3eac.png"
  }
  ],
  "reminders": {
  "useDefault": true
  },
  "sequence": 0,
  "start": {
  "timeZone": "Europe/Minsk",
  "dateTime": "2024-02-21T15:16:25+03:00"
  },
  "creator": {
  "self": true,
  "email": "bayselonarrend@gmail.com"
  },
  "end": {
  "timeZone": "Europe/Minsk",
  "dateTime": "2024-02-21T16:16:25+03:00"
  },
  "iCalUID": "j4nonfcc0m2mtop1vc8ivo8tb8@google.com",
  "description": "TestEventDescription",
  "updated": "2024-02-21T09:16:28.474Z",
  "created": "2024-02-21T09:16:28.000Z",
  "htmlLink": "https://www.google.com/calendar/event?eid=ajRub25mY2MwbTJtdG9wMXZjOGl2bzh0YjggYmF5c2Vsb25hcnJlbmRAbQ",
  "location": "On office",
  "summary": "New event",
  "organizer": {
  "self": true,
  "email": "bayselonarrend@gmail.com"
  },
  "status": "confirmed",
  "id": "j4nonfcc0m2mtop1vc8ivo8tb8",
  "etag": "\"3417013976948000\"",
  "kind": "calendar#event"
  }