From b7058b60e08253e6c4d7fa5997a50c1807a79ea3 Mon Sep 17 00:00:00 2001 From: mouna-elmaazouzi Date: Wed, 11 Jun 2025 13:43:48 +0100 Subject: [PATCH 01/26] Added 7 commands + event object --- docs/Google.md | 508 ++++++++++++++++++++++++++++++----------- docs/Office365.md | 566 ++++++++++++++++++++++++++++++++++++---------- 2 files changed, 814 insertions(+), 260 deletions(-) diff --git a/docs/Google.md b/docs/Google.md index bfafa18..1f9f39e 100644 --- a/docs/Google.md +++ b/docs/Google.md @@ -11,32 +11,49 @@ The `Google` class is instantiated by calling the `cs.NetKit.Google.new()` funct **Warning:** Shared objects are not supported by the 4D NetKit API. -## Table of contents - -- [cs.NetKit.Google.new()](#csnetkitgooglenew) -- [Google.Calendar.getCalendar()](#googlecalendargetcalendar) -- [Google.Calendar.getCalendars()](#googlecalendargetCalendars) -- [Google.Calendar.getEvent()](#googlecalendargetevent) -- [Google.Calendar.getEvents()](#googlecalendargetevents) -- [Google.mail.append()](#googlemailappend) -- [Google.mail.createLabel()](#googlemailcreatelabel) -- [Google.mail.delete()](#googlemaildelete) -- [Google.mail.deleteLabel()](#googlemaildeletelabel) -- [Google.mail.getLabel()](#googlemailgetlabel) -- [Google.mail.getLabelList()](#googlemailgetlabellist) -- [Google.mail.getMail()](#googlemailgetmail) -- [Google.mail.getMailIds()](#googlemailgetmailids) -- [Google.mail.getMails()](#googlemailgetmails) -- [Google.mail.send()](#googlemailsend) -- [Google.mail.untrash()](#googlemailuntrash) -- [Google.mail.update()](#googlemailupdate) -- [Google.mail.updateLabel()](#googlemailupdatelabel) -- [Google.user.get()](#googleuserget) -- [Google.user.getCurrent()](#googleusergetcurrent) -- [Google.user.list()](#googleuserlist) -- [labelInfo object](#labelinfo-object) -- [Status object (Google Class)](#status-object-google-class) +## Table of Contents +### [Initialization](#csnetkitgooglenew) + +* [cs.NetKit.Google.new()](#csnetkitgooglenew) + +### [Calendar](#calendar) + +* [Google.Calendar.getCalendar()](#googlecalendargetcalendar) +* [Google.Calendar.getCalendars()](#googlecalendargetcalendars) +* [Google.Calendar.getEvent()](#googlecalendargetevent) +* [Google.Calendar.getEvents()](#googlecalendargetevents) +* [Google.Calendar.createEvent()](#googlecalendarcreateevent) +* [Google.Calendar.updateEvent()](#googlecalendarupdateevent) +* [Google.Calendar.deleteEvent()](#googlecalendardeleteevent) +* [Event object](#event-object) + +### [Mail](#mail) + +* [Google.mail.send()](#googlemailsend) +* [Google.mail.append()](#googlemailappend) +* [Google.mail.update()](#googlemailupdate) +* [Google.mail.createLabel()](#googlemailcreatelabel) +* [Google.mail.updateLabel()](#googlemailupdatelabel) +* [Google.mail.deleteLabel()](#googlemaildeletelabel) +* [Google.mail.delete()](#googlemaildelete) +* [Google.mail.getLabel()](#googlemailgetlabel) +* [Google.mail.getLabelList()](#googlemailgetlabellist) +* [Google.mail.getMail()](#googlemailgetmail) +* [Google.mail.getMailIds()](#googlemailgetmailids) +* [Google.mail.getMails()](#googlemailgetmails) +* [Google.mail.untrash()](#googlemailuntrash) +* [labelInfo object](#labelinfo-object) + +### [User](#user) + +* [Google.user.get()](#googleuserget) +* [Google.user.getCurrent()](#googleusergetcurrent) +* [Google.user.list()](#googleuserlist) + +### [Status](#status-object-google-class) + +* [Status object](#status-object-google-class) ## **cs.NetKit.Google.new()** @@ -85,11 +102,13 @@ $oAuth2:=New OAuth2 provider($param) $google:=cs.NetKit.Google.new($oAuth2;New object("mailType"; "MIME")) ``` -## Google.Calendar.getCalendar() +## Calendar + +### Google.Calendar.getCalendar() **Google.Calendar.getCalendar**( { *id* : Text } ) : Object -### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| @@ -98,11 +117,11 @@ $google:=cs.NetKit.Google.new($oAuth2;New object("mailType"; "MIME")) > To retrieve calendar IDs call the getCalendars() function. If id is null, empty or missing, returns the primary calendar of the currently logged in user. -### Description +#### Description `Google.Calendar.getCalendar()` retrieves a specific calendar from the authenticated user's calendar list; using an `id` to identify the calendar and returns a `calendar` object containing details about the requested calendar. -### Example +#### Example ```4d @@ -133,18 +152,18 @@ $myCalendar:=$google.calendar.getCalendar($Calendars.calendars[0].id) ``` -## Google.Calendar.getCalendars() +### Google.Calendar.getCalendars() **Google.Calendar.getCalendar**( { *param* : Object } ) : Object -### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| |param|Object|->|Set of options to filter or refine the calendar list request.| |Result|Object|<-|Object containing the calendar list with the related data.| -### Description +#### Description `Google.Calendar.getCalendars()` retrieves a list of calendars that the authenticated user can access. The passed filtering and paging options in `param` are returned in the `result` object. @@ -161,7 +180,7 @@ In *param*, you can pass the following optional properties: | showDeleted | Boolean | Whether to include deleted calendar list entries in the result. Optional. The default is False.| | showHidden | Boolean | Whether to show hidden entries. Optional. The default is False.| -### Returned object +#### Returned object The function returns a Collection of details about the user's calendar list in the following properties: @@ -184,7 +203,7 @@ The function returns a Collection of details about the user's calendar list in t | | | - `.componentSignature`: Signature of the component that returned the error. | -### Example +#### Example ```4d @@ -211,18 +230,18 @@ $google:=cs.NetKit.Google.new($oauth2) $Calendars:=$google.calendar.getCalendars() ``` -## Google.Calendar.getEvent() +### Google.Calendar.getEvent() **Google.Calendar.getEvent**( *param* : Object ) : Object -### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| |param|Object|->|Object containing the necessary details to retrieve a specific event| |Result|Object|<-|Object containing the retrieved event| -### Description +#### Description `Google.Calendar.getEvent()` retrieves a specific event from a Google Calendar using its unique `eventId`. @@ -235,22 +254,22 @@ In *param*, you can pass the following properties: | maxAttendees | Integer | Max number of attendees to be returned for the event| | timeZone | String | Time zone used in the response (formatted as an IANA Time Zone Database name, e.g., "Europe/Zurich"). Defaults to UTC | -### Returned object +#### Returned object The function returns a Google [`event`](https://developers.google.com/calendar/api/v3/reference/events) object. -## Google.Calendar.getEvents() +### Google.Calendar.getEvents() **Google.Calendar.getEvents**( { *param* : Object } ) : Object -### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| |param|Object|->|Object containing filters and options for retrieving calendar events| |Result|Object|<-|Object containing the retrieved events| -### Description +#### Description `Google.Calendar.getEvents()` retrieves events on the specified calendar. If *param* is not provided, it returns all events from the user's primary calendar. @@ -275,7 +294,7 @@ In *param*, you can pass the following optional properties: | timeZone | String | Time zone for the response, formatted as an IANA Time Zone Database name (e.g., "Europe/Zurich"). Defaults to UTC | | updatedMin | Text | Filters events based on last modification time (`ISO 8601 UTC`). When set, deleted events since this time are always included, regardless of `showDeleted` | -### Returned object +#### Returned object The method returns a [**status object**](#status-object-google-class) in addition to the following properties: @@ -298,7 +317,7 @@ The method returns a [**status object**](#status-object-google-class) in additio | defaultReminders[].minutes | Integer | Minutes before the event when the reminder triggers. | | events | Collection | List of events on the calendar. If some events have attachments, an "attachments" attribute is added, containing a collection of attachments. | -### Example +#### Example ```4d @@ -312,13 +331,230 @@ var $events:=$google.calendar.getEvents({calendarId: $myCalendar.id; top: 10}) ``` -## Google.mail.append() +### Google.calendar.createEvent() + +**Google.calendar.createEvent**(*event*: Object{; *option*: Object}) : Object + +#### Parameters + +| Parameter | Type | | Description| +| -------- | ------ | --- |--------------------------- | +|event | Object | ->|Object containing details of the calendar [event](#event-object) to create | +|option | Object | -> | Object containing additional creation options | +|Result|Object|<-|[Status object](#status-object-google-class)| + +#### Description + +`Google.calendar.createEvent()` creates a new calendar event. + +In *event*, you must include the following required properties: + +| Property | Type | Description | +|--------------|--------|-------------| +| start | Object | Start time of the event. | +| end | Object | End time of the event. | + +And in *options*, you can pass the following additional optional properties: + +|Property|Type|Description| +|---------|--- |------| +|sendUpdates|String|Defines who should receive email notifications about the event. Acceptable values:
• `"all"` – Notify all attendees.
• `"externalOnly"` – Notify only non-Google users.
• `"none"` – No notifications sent.| +|supportsAttachments|Boolean| Indicates whether the API client supports attachments. Must be `true` to create or modify the `attachments` property. Defaults to `false` | + +#### Returned Object + +The method returns a [**status object**](status-object-google-class) with an additional "event" property: + +|Property|Type|Description| +|---------|--- |------| +|event|Object|Event object returned by the server| +|success|Boolean| [see Status object](#status-object-google-class)| +|statusText|Text| [see Status object](#status-object-google-class)| +|errors|Collection| [see Status object](#status-object-google-class)| + +#### Example + +Create an event in the Google calendar: + +```4d +var $Google : cs.NetKit.Google +var $event; $result : Object + +$event:=New object +$event.summary:="Team Meeting" +$event.start:=New object +$event.start.dateTime:="2025-06-15T09:00:00" +$event.start.timeZone:="Europe/Paris" +$event.end:=New object +$event.end.dateTime:="2025-06-15T10:00:00" +$event.end.timeZone:="Europe/Paris" + +$result:=$Google.calendar.createEvent($event) +If (Not($result.success)) + ALERT($result.statusText) +End if +``` + +### Google.calendar.updateEvent() + +**Google.calendar.updateEvent**(*event*: Object{; *option*: Object}) : Object + +#### Parameters + +| Parameter | Type | | Description| +| -------- | ----- | -------- | --------------- | +|event |Object|->| Object containing details of the calendar [event](#event-object) to update. | +|option |Object|->| Object containing additional update options. | +|Result | Object | <-| [Status object](#status-object-google-class) | + +#### Description + +`Google.calendar.updateEvent()` updates an existing event. + +In *event*, you must include the following required properties: + +| Property | Type | Description | +|----------|--------|-------------| +| id | Text | ID of the event to update. | +| start | Object | Start time of the event. | +| end | Object | End time of the event. | + +And in *option*, you can pass the following additional optional properties: + +| Property | Type | Description | +|------------|---------|-------------| +| sendUpdates | String | Defines who should receive email notifications about the update. Acceptable values:
• `"all"` – Notify all attendees.
• `"externalOnly"` – Notify only non-Google users.
• `"none"` – No notifications sent. | +| supportsAttachments | Boolean | Indicates whether the API client supports attachments. Must be `true` to modify the `attachments` property. Defaults to `false`. | +| fullUpdate | Boolean | If `true`, the full event is replaced. If `false` (default), only specified fields are updated. | + +> **Note:** This method replaces the entire event with the data you send. To avoid losing information, always include required fields like `start` and `end`. + +#### Returned Object + +The method returns a [**status object**](status-object-google-class) with an additional "event" property: + +|Property|Type|Description| +|---------|--- |------| +|event|Object|Updated event object returned by the server| +|success|Boolean| [see Status object](#status-object-google-class)| +|statusText|Text| [see Status object](#status-object-google-class)| +|errors|Collection| [see Status object](#status-object-google-class)| + +#### Example + +Update an already existing event: + +```4d +#DECLARE(event:object) +var $Google : cs.NetKit.Google +var $result : Object + +$event.summary:="Updated Event Title" +$event.start:=New object +$event.start.dateTime:="2025-06-15T11:00:00" +$event.start.timeZone:="Europe/Paris" +$event.end:=New object +$event.end.dateTime:="2025-06-15T12:00:00" +$event.end.timeZone:="Europe/Paris" + +$result:=$Google.calendar.updateEvent($event) +If (Not($result.success)) + ALERT($result.statusText) +End if +``` + + +### Google.calendar.deleteEvent() + +**Google.calendar.deleteEvent**(*param*: Object) : Object + +#### Parameters + +| Parameter | Type | | Description | +| -------- | ----- | --- | -------------------- | +| param | Object | -> | Object containing details of the calendar [event](#event-object) to delete | +|Result|Object|<-|[Status object](#status-object-google-class)| + +#### Description + +`Google.calendar.deleteEvent()` deletes an event from a specified calendar. + +In *param*, you can pass the following properties: + +|Property|Type|Description| +|---------|--- |------| +| eventId | String | **Required.** ID of the event to delete| +| calendarId | String |**Optional.** Calendar ID. If not provided or null, uses the user's primary calendar. To retrieve calendar IDs, call `Google.calendar.getCalendars()`| +| sendUpdates | String |**Optional.** Controls which attendees of the event receive notifications about the deletion. Acceptable values:
• `"all"` – Notify all attendees of the event (Google or non-Google users)
• `"externalOnly"` – Notify only non-Google users
• `"none"` – No notifications sent| + +#### Returned Object + +The method returns a standard [**status object**](#status-object-google-class). + +#### Example + +Delete a calendar event: + +```4d +$status:=$google.calendar.deleteEvent({eventId: $event.event.id}) +``` + +### Event object + +The `event` object used with Google Calendar methods includes the following properties: + +| Property | | Type | Description| +| ------ |---| -------- | ------------------- | +| calendarId | | Text | Calendar ID. If not provided, the user's primary calendar is used. Use `Google.calendar.getCalendars()` to retrieve IDs.| +| attachments | | Collection | File attachments (max 25). To use this, `supportsAttachments` must be set to `true` in the request.| +| attendees| | Collection | List of attendees. | +| | email | String | **Required.** Email address of the attendee. | +| | displayName | String | Name of the attendee. | +| | comment| String | The attendee’s response comment. | +| | optional| Boolean | (Default: false) Whether the attendee is optional.| +| | resource| Boolean | (Default: false) Set to `true` when the attendee is a resource (e.g., room or equipment). Can only be set when the attendee is first added. Ignored in later updates. | +| | additionalGuests| Integer | (Default: `0`) Allowed number of additional guests of the attendee. | +| description | | Text | Description of the event (HTML allowed).| +| start | | Object | Start time. Use `dateTime` with optional `timeZone`, or `date` for all-day events.| +| | date | Date, Text | Start date of the event. If provided as text, use the format `"yyyy-mm-dd"`. | +| | time | Time |Start time of the event (not present if all-day event)| +| | dateTime | Text | Combined start date and time in RFC3339 format. A time zone offset is required unless `timeZone` is specified. IOverrides `date` and `time`.(not used for all-day events). | +| | timeZone | String | Time zone for the `dateTime`, using IANA format (e.g., `"Europe/Zurich"`). Defaults to UTC if not provided. | +| end | | Object | End time. Use `dateTime` with optional `timeZone`, or `date` for all-day events.| +| | date | Date, Text | End date of the event. If provided as text, use the format `"yyyy-mm-dd"`. | +| | time | Time |End time of the event (not present if all-day event)| +| | dateTime | Text |Combined date and time in RFC3339 format. A time zone offset is required unless `timeZone` is specified. Overrides `date` and `time`.(not used for all-day events). | +| | timeZone | String | Time zone for the `dateTime`, using IANA format (e.g., `"Europe/Zurich"`). Defaults to UTC if not provided. | +| eventType | | Text | Specific type of the event (Cannot be changed after creation).
Possible values: `"default"`, `"birthday"`, `"focusTime"`, `"outOfOffice"`, etc.| +| extendedProperties.private | | Object | [Custom key-value pairs](https://developers.google.com/calendar/api/v3/reference/events#extendedProperties) only visible to the event owner to store additional information (e.g; `"internalNote": "Discuss Q3 targets"`)| +| extendedProperties.shared | | Object | [Custom key-value pairs](https://developers.google.com/calendar/api/v3/reference/events#extendedProperties) shared with all attendees to share additional notes or tags (e.g., `"projectCode": "XYZ123"`).| +| focusTimeProperties| | Object | [Focus Time event-specific settings](https://developers.google.com/calendar/api/v3/reference/events#focustimeproperties). Used when `eventType` is `"focusTime"`.| +| guestsCanInviteOthers | | Boolean | (Default: true) If attendees can invite guests. | +| guestsCanModify | | Boolean | (Default: false) If attendees can edit the event. | +| guestsCanSeeOtherGuests| | Boolean | (Default: true) If attendees can see each other.| +| location | | Text | Event location.| +| recurrence\[] | | List | List of ***RRULE**( the main rule (e.g., FREQ=WEEKLY;BYDAY=MO))/**EXRULE**(exceptions to the rule)/**RDATE**(specific additional dates to include)/**EXDATE**(specific dates to exclude)* rules for repeating events using [RFC5545](https://www.rfc-editor.org/rfc/rfc5545) format. Does not include start/end times, use the `start` and `end` for that. Omit this field for one-time events. | +| reminders.useDefault | | Boolean | Whether to use the calendar’s default reminders.| +| reminders.overrides\[] | | List | Custom reminders.| +| | method | String | **Required**. Method of the reminder: "email" or "popup"| +| | minutes | Integer | **Required**. Time before event (in minutes) when reminder should trigger. Between 0 and 40320.| +| reminders.useDefault | | Boolean | Whether the default reminders of the calendar apply to the event.| +| source.title | | Text | Title of the source linked to the event, such as a web page or email subject.| +| source.url | | Text | URL of the source linked to the event (must use `http` or `https`).| +| status | | Text |Describes the event's current state.
Possible values: `"confirmed"` (default) `"tentative"`, or `"cancelled"`.| +| summary | | Text | Title of the event.| +| transparency | | Text | Whether the event blocks time on the calendar. Values: `"opaque"` (busy) or `"transparent"` (available).| +| visibility | | Text | Visibility level: `"default"`, `"public"`, `"private"`, or `"confidential"`.| + +## Mail + +### Google.mail.append() **Google.mail.append**( *mail* : Text { ; *labelIds* : Collection } ) : Object
**Google.mail.append**( *mail* : Blob { ; *labelIds* : Collection } ) : Object
**Google.mail.append**( *mail* : Object { ; *labelIds* : Collection } ) : Object
-### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| @@ -327,13 +563,13 @@ var $events:=$google.calendar.getEvents({calendarId: $myCalendar.id; top: 10}) |Result|Object|<-|[Status object](#status-object-google-class)| -### Description +#### Description `Google.mail.append()` appends *mail* to the user's mailbox as a DRAFT or with designated *labelIds*. >If the *labelIds* parameter is passed and the mail has a "from" or "sender" header, the Gmail server automatically adds the SENT label. -### Returned object +#### Returned object The method returns a [**status object**](status-object-google-class) with an additional "id" property: @@ -344,7 +580,7 @@ The method returns a [**status object**](status-object-google-class) with an add |statusText|Text| [see Status object](#status-object-google-class)| |errors|Collection| [see Status object](#status-object-google-class)| -### Example +#### Example To append an email : @@ -358,22 +594,22 @@ By default, the mail is created with a DRAFT label. To change the designated lab $status:=$google.mail.append($mail;["INBOX"]) ``` -## Google.mail.createLabel() +### Google.mail.createLabel() **Google.mail.createLabel**( *labelInfo* : Object ) : Object -### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| |[labelInfo](#labelinfo-object)|Object|->|Label information.| |Result|Object|<-|[Status object](#status-object-google-class)| -### Description +#### Description `Google.mail.createLabel()` creates a new label. -### Returned object +#### Returned object The method returns a [**status object**](status-object-google-class) with an additional "label" property: @@ -384,7 +620,7 @@ The method returns a [**status object**](status-object-google-class) with an add |statusText|Text| [see Status object](#status-object-google-class)| |errors|Collection| [see Status object](#status-object-google-class)| -### Example +#### Example To create a label named 'Backup': @@ -393,11 +629,11 @@ $status:=$google.mail.createLabel({name: "Backup"}) $labelId:=$status.label.id ``` -## Google.mail.delete() +### Google.mail.delete() **Google.mail.delete**( *mailID* : Text { ; *permanently* : Boolean } ) : Object -### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| @@ -406,15 +642,15 @@ $labelId:=$status.label.id |Result|Object|<-|[Status object](#status-object-google-class)| -### Description +#### Description `Google.mail.delete()` deletes the specified message from the user's mailbox. -### Returned object +#### Returned object The method returns a standard [**status object**](#status-object-google-class). -### Permissions +#### Permissions This method requires one of the following OAuth scopes: @@ -423,7 +659,7 @@ https://mail.google.com/ https://www.googleapis.com/auth/gmail.modify ``` -### Example +#### Example To delete an email permanently: @@ -431,28 +667,28 @@ To delete an email permanently: $status:=$google.mail.delete($mailId; True) ``` -## Google.mail.deleteLabel() +### Google.mail.deleteLabel() **Google.mail.deleteLabel**( *labelId* : Text ) : Object -### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| |labelId|Text|->|The ID of the label| |Result|Object|<-|[Status object](#status-object-google-class)| -### Description +#### Description `Google.mail.deleteLabel()` immediately and permanently deletes the specified label and removes it from any messages and threads that it is applied to. > This method is only available for labels with type="user". -### Returned object +#### Returned object The method returns a standard [**status object**](#status-object-google-class). -### Example +#### Example To delete a label: @@ -461,22 +697,22 @@ $status:=$google.mail.deleteLabel($labelId) ``` -## Google.mail.getLabel() +### Google.mail.getLabel() **Google.mail.getLabel**( *labelId* : Text ) : Object -### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| |labelId|Text|->|The ID of the label| |Result|Object|<-|[labelInfo](#labelinfo-object)| -### Description +#### Description `Google.mail.getLabel()` returns the information of a label as a [labelInfo](#labelinfo-object) object. -### Returned object +#### Returned object The returned [**labelInfo**](#labelinfo-object) object contains the following additional properties: @@ -488,7 +724,7 @@ The returned [**labelInfo**](#labelinfo-object) object contains the following ad |threadsTotal|Integer|The total number of threads with the label.| |threadsUnread|Integer|The number of unread threads with the label.| -### Example +#### Example To retrieve the label name, total message count, and unread messages: @@ -499,22 +735,22 @@ $emailNumber:=$info.messagesTotal $unread:=$info.messagesUnread ``` -## Google.mail.getLabelList() +### Google.mail.getLabelList() **Google.mail.getLabelList**() : Object -### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| |Result|Object|<-| Status object | -### Description +#### Description `Google.mail.getLabelList()` returns an object containing the collection of all labels in the user's mailbox. -### Returned object +#### Returned object The method returns a [**status object**](status-object-google-class) with an additional "labels" property: @@ -526,7 +762,7 @@ The method returns a [**status object**](status-object-google-class) with an add |errors|Collection| [see Status object](#status-object-google-class)| -### mailLabel object +#### mailLabel object A `mailLabel` object contains the following properties (note that additional information can be returned by the server): @@ -539,11 +775,11 @@ A `mailLabel` object contains the following properties (note that additional inf |type|Text| Owner type for the label:
- "user": User labels are created by the user and can be modified and deleted by the user and can be applied to any message or thread.
- "system": System labels are internally created and cannot be added, modified, or deleted. System labels may be able to be applied to or removed from messages and threads under some circumstances but this is not guaranteed. For example, users can apply and remove the INBOX and UNREAD labels from messages and threads, but cannot apply or remove the DRAFTS or SENT labels from messages or threads.| -## Google.mail.getMail() +### Google.mail.getMail() **Google.mail.getMail**( *mailID* : Text { ; *options* : Object } ) : Object
**Google.mail.getMail**( *mailID* : Text { ; *options* : Object } ) : Blob
-### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| @@ -552,7 +788,7 @@ A `mailLabel` object contains the following properties (note that additional inf |Result|Object | Blob|<-| Downloaded mail| -### Description +#### Description `Google.mail.getMail()` gets the specified message from the user's mailbox. @@ -566,7 +802,7 @@ In *options*, you can pass several properties: -### Returned object +#### Returned object The method returns a mail in one of the following formats, depending on the `mailType`: @@ -577,18 +813,18 @@ The method returns a mail in one of the following formats, depending on the `mai -## Google.mail.getMailIds() +### Google.mail.getMailIds() **Google.mail.getMailIds**( { *options* : Object } ) : Object -### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| |options|Object|->|Options for messages to get | |Result|Object|<-| Status object | -### Description +#### Description `Google.mail.getMailIds()` returns an object containing a collection of message ids in the user's mailbox. @@ -603,7 +839,7 @@ In *options*, you can pass several properties: -### Returned object +#### Returned object The method returns a [**status object**](status-object-google-class) with additional properties: @@ -619,7 +855,7 @@ The method returns a [**status object**](status-object-google-class) with additi |errors|Collection| [see Status object](#status-object-google-class)| -### Permissions +#### Permissions This method requires one of the following OAuth scopes: @@ -629,11 +865,11 @@ https://www.googleapis.com/auth/gmail.readonly https://www.googleapis.com/auth/gmail.metadata ``` -## Google.mail.getMails() +### Google.mail.getMails() **Google.mail.getMails**( *mailIDs* : Collection { ; *options* : Object } ) : Collection -### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| @@ -642,7 +878,7 @@ https://www.googleapis.com/auth/gmail.metadata |Result|Collection|<-|Collection of mails in format depending on *mailType*: JMAP (collection of objects) or MIME (collection of blobs)
If no mail is returned, the collection is empty| -### Description +#### Description `Google.mail.getMails()` gets a collection of emails based on the specified *mailIDs* collection. @@ -658,7 +894,7 @@ In *options*, you can pass several properties: -### Returned value +#### Returned value The method returns a collection of mails in one of the following formats, depending on the `mailType`: @@ -669,18 +905,18 @@ The method returns a collection of mails in one of the following formats, depend -## Google.mail.send() +### Google.mail.send() **Google.mail.send**( *email* : Text ) : Object
**Google.mail.send**( *email* : Object ) : Object
**Google.mail.send**( *email* : Blob ) : Object -### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| |email|Text | Blob | Object|->| Email to be sent| |Result|Object|<-| [Status object](#status-object-google-class) | -### Description +#### Description `Google.mail.send()` sends an email using the MIME or JMAP formats. @@ -698,15 +934,15 @@ $status:=$Google.mail.send($email) > To avoid authentication errors, make sure your application has appropriate authorizations to send emails. One of the following OAuth scopes is required: [modify](https://www.googleapis.com/auth/gmail.modify), [compose](https://www.googleapis.com/auth/gmail.compose), or [send](https://www.googleapis.com/auth/gmail.send). For more information, see the [Authorization guide](https://developers.google.com/workspace/guides/configure-oauth-consent). -### Returned object +#### Returned object The method returns a standard [**status object**](#status-object-google-class). -## Google.mail.untrash() +### Google.mail.untrash() **Google.mail.untrash**( *mailID* : Text ) : Object -### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| @@ -714,15 +950,15 @@ The method returns a standard [**status object**](#status-object-google-class). |Result|Object|<-|[Status object](#status-object-google-class)| -### Description +#### Description `Google.mail.untrash()` removes the specified message from the trash. -### Returned object +#### Returned object The method returns a standard [**status object**](#status-object-google-class). -### Permissions +#### Permissions This method requires one of the following OAuth scopes: @@ -731,11 +967,11 @@ https://mail.google.com/ https://www.googleapis.com/auth/gmail.modify ``` -## Google.mail.update() +### Google.mail.update() **Google.mail.update**( *mailIDs* : Collection ; *options* : Object) : Object -### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| @@ -745,7 +981,7 @@ https://www.googleapis.com/auth/gmail.modify > There is a limit of 1000 IDs per request. -### Description +#### Description `Google.mail.update()` adds or removes labels on the specified messages to help categorizing emails. The label can be a system label (e.g., NBOX, SPAM, TRASH, UNREAD, STARRED, IMPORTANT) or a custom label. Multiple labels could be applied simultaneously. @@ -759,12 +995,12 @@ In *options*, you can pass the following two properties: |removeLabelIds|Collection|A collection of label IDs to remove from messages.| -### Returned object +#### Returned object The method returns a standard [**status object**](#status-object-google-class). -### Example +#### Example To mark a collection of emails as "unread": @@ -772,11 +1008,11 @@ To mark a collection of emails as "unread": $result:=$google.mail.update($mailIds; {addLabelIds: ["UNREAD"]}) ``` -## Google.mail.updateLabel() +### Google.mail.updateLabel() **Google.mail.updateLabel**( *labelId* : Text ; *labelInfo* : Object ) : Object -### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| @@ -784,12 +1020,12 @@ $result:=$google.mail.update($mailIds; {addLabelIds: ["UNREAD"]}) |[labelInfo](#labelinfo-object)|Object|->|Label information to update| |Result|Object|<-|[Status object](#status-object-google-class)| -### Description +#### Description `Google.mail.updateLabel()` updates the specified label. > This method is only available for labels with type="user". -### Returned object +#### Returned object The method returns a [**status object**](status-object-google-class) with an additional "label" property: @@ -800,7 +1036,7 @@ The method returns a [**status object**](status-object-google-class) with an add |statusText|Text| [see Status object](#status-object-google-class)| |errors|Collection| [see Status object](#status-object-google-class)| -### Example +#### Example To update a previously created label to 'Backup January': @@ -809,13 +1045,27 @@ $status:=$google.mail.updateLabel($labelId; {name:"Backup January"}) ``` +### labelInfo object -## Google.user.get() +Several Google.mail label management methods use a `labelInfo` object, containing the following properties: + +|Property|Type|Description| +|---------|--- |------| +|id|Text|The ID of the label.| +|name|Text|The display name of the label. (mandatory)| +|messageListVisibility|Text|The visibility of messages with this label in the message list.

Can be:
- "show": Show the label in the message list. <
- "hide": Do not show the label in the message list. | +|labelListVisibility|Text|The visibility of the label in the label list.

Can be:
- "labelShow": Show the label in the label list.
- "labelShowIfUnread" : Show the label if there are any unread messages with that label.
- "labelHide": Do not show the label in the label list. | +|[color](https://developers.google.com/gmail/api/reference/rest/v1/users.labels?hl=en#color)|Object|The color to assign to the label (color is only available for labels that have their type set to user).

The color object has 2 attributes :
- textColor: text: The text color of the label, represented as hex string. This field is required in order to set the color of a label.
- backgroundColor: text: The background color represented as hex string #RRGGBB (ex for black: #000000). This field is required in order to set the color of a label. | +|type|Text|The owner type for the label.

Can be:
- "system": Labels created by Gmail.
- "user": Custom labels created by the user or application.
System labels are internally created and cannot be added, modified, or deleted. They're may be able to be applied to or removed from messages and threads under some circumstances but this is not guaranteed. For example, users can apply and remove the INBOX and UNREAD labels from messages and threads, but cannot apply or remove the DRAFTS or SENT labels from messages or threads.
User labels are created by the user and can be modified and deleted by the user and can be applied to any message or thread. | + +## User + +### Google.user.get() **Google.user.get**( *id* : Text {; *select* : Text } ) : Object
**Google.user.get**( *id* : Text {; *select* : Collection } ) : Object -### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| @@ -823,20 +1073,20 @@ $status:=$google.mail.updateLabel($labelId; {name:"Backup January"}) |select|Text \| Collection|->|Text: A comma-separated list of specific fields that you want to retrieve from each person (e.g., "names, phoneNumbers").
Collection: Collection of the specific fields.| |Result|Object|<-|Represents user's details, like names, emails, and phone numbers based on the selected fields.| -### Description +#### Description `Google.user.get()` provides information about a [user](https://developers.google.com/people/api/rest/v1/people#Person) based on the *resourceName* provided in `id` and fields optionally specified in `select`. Supported fields include *addresses*, *ageRanges*, *biographies*, *birthdays*, *calendarUrls*, *clientData*, *coverPhotos*, *emailAddresses*, *events*, *externalIds*, *genders*, *imClients*, *interests*, *locales*, *locations*, *memberships*, *metadata*, *miscKeywords*, *names*, *nicknames*, *occupations*, *organizations*, *phoneNumbers*, *photos*, *relations*, *sipAddresses*, *skills*, *urls*, *userDefined*. -### Returned object +#### Returned object The returned [user object](https://developers.google.com/people/api/rest/v1/people#Person) contains values for the specified field(s). If no fields have been specified in `select`, `Google.user.get()` returns *emailAddresses* and *names*. Otherwise, it returns only the specified field(s). -### Permissions +#### Permissions No authorization required to access public data. For private data, one of the following OAuth scopes is required: @@ -857,35 +1107,35 @@ https://www.googleapis.com/auth/userinfo.email
https://www.googleapis.com/auth/userinfo.profile
https://www.googleapis.com/auth/profile.language.read -## Google.user.getCurrent() +### Google.user.getCurrent() **Google.user.getCurrent**( { *select* : Text } ) : Object
**Google.user.getCurrent**( { *select* : Collection } ) : Object -### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| |select|Text \| Collection|->|Text: A comma-separated list of specific fields that you want to retrieve from each person (e.g., "names, phoneNumbers").
Collection: Collection of the specific fields.| |Result|Object|<-|Represents user's details, like names, emails, and phone numbers based on the selected fields.| -### Description +#### Description `Google.user.getCurrent()` provides information about the authenticated [user](https://developers.google.com/people/api/rest/v1/people#Person) based on fields specified in `select`. Supported fields include *addresses*, *ageRanges*, *biographies*, *birthdays*, *calendarUrls*, *clientData*, *coverPhotos*, *emailAddresses*, *events*, *externalIds*, *genders*, *imClients*, *interests*, *locales*, *locations*, *memberships*, *metadata*, *miscKeywords*, *names*, *nicknames*, *occupations*, *organizations*, *phoneNumbers*, *photos*, *relations*, *sipAddresses*, *skills*, *urls*, *userDefined*. -### Returned object +#### Returned object The returned [user object](https://developers.google.com/people/api/rest/v1/people#Person) contains values for the specific field(s). If no fields have been specified in `select`, `Google.user.getCurrent()` returns *emailAddresses* and *names*. Otherwise, it returns only the specified field(s). -### Permissions +#### Permissions Requires the same OAuth scope package as [Google.user.get()](#permissions-15). -### Example +#### Example To retrieve information from the current user: @@ -929,18 +1179,18 @@ var $currentUser2:=$google.user.getCurrent("phoneNumbers") //returns the field "phoneNumbers" ``` -## Google.user.list() +### Google.user.list() **Google.user.list**( { *options* : Object } ) : Object -### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| |options|Object|->|A set of options defining how to retrieve and filter user data| |Result|Object|<-|An object containing a structured collection of [user](https://developers.google.com/people/api/rest/v1/people#Person) data organized into pages| -### Description +#### Description `Google.user.list()` provides a list of domain profiles or domain contacts in the authenticated user's domain directory. @@ -955,7 +1205,7 @@ In *options*, you can pass the following properties: |mergeSources|Text \| Collection|Adds related data if linked by verified join keys such as email addresses or phone numbers.
- DIRECTORY_MERGE_SOURCE_TYPE_UNSPECIFIED (Unspecified),
- DIRECTORY_MERGE_SOURCE_TYPE_CONTACT (User owned contact).| |top|Integer|Sets the maximum number of people to retrieve per page, between 1 and 1000 (default is 100).| -### Returned object +#### Returned object The returned object holds a collection of [users objects](https://developers.google.com/people/api/rest/v1/people#Person) as well as [**status object**](status-object-google-class) properties and functions that allow you to navigate between different pages of results. @@ -970,11 +1220,11 @@ The returned object holds a collection of [users objects](https://developers.goo |statusText|Text| [see Status object](#status-object-google-class)| |errors|Collection| [see Status object](#status-object-google-class)| -### Permissions +#### Permissions Requires the same OAuth scope package as [Google.user.get()](#permissions-15). -### Example +#### Example To retrieve user data in a structured collection organized into pages with a maximum of `top` users per page: @@ -1014,18 +1264,6 @@ var $userList:=$google.user.list({top:10}) ``` -## labelInfo object - -Several Google.mail label management methods use a `labelInfo` object, containing the following properties: - -|Property|Type|Description| -|---------|--- |------| -|id|Text|The ID of the label.| -|name|Text|The display name of the label. (mandatory)| -|messageListVisibility|Text|The visibility of messages with this label in the message list.

Can be:
- "show": Show the label in the message list. <
- "hide": Do not show the label in the message list. | -|labelListVisibility|Text|The visibility of the label in the label list.

Can be:
- "labelShow": Show the label in the label list.
- "labelShowIfUnread" : Show the label if there are any unread messages with that label.
- "labelHide": Do not show the label in the label list. | -|[color](https://developers.google.com/gmail/api/reference/rest/v1/users.labels?hl=en#color)|Object|The color to assign to the label (color is only available for labels that have their type set to user).

The color object has 2 attributes :
- textColor: text: The text color of the label, represented as hex string. This field is required in order to set the color of a label.
- backgroundColor: text: The background color represented as hex string #RRGGBB (ex for black: #000000). This field is required in order to set the color of a label. | -|type|Text|The owner type for the label.

Can be:
- "system": Labels created by Gmail.
- "user": Custom labels created by the user or application.
System labels are internally created and cannot be added, modified, or deleted. They're may be able to be applied to or removed from messages and threads under some circumstances but this is not guaranteed. For example, users can apply and remove the INBOX and UNREAD labels from messages and threads, but cannot apply or remove the DRAFTS or SENT labels from messages or threads.
User labels are created by the user and can be modified and deleted by the user and can be applied to any message or thread. | ## Status object diff --git a/docs/Office365.md b/docs/Office365.md index ac89671..5e7ae7d 100644 --- a/docs/Office365.md +++ b/docs/Office365.md @@ -15,35 +15,52 @@ The `Office365` class can be instantiated in two ways: **Warning:** Shared objects are not supported by the 4D NetKit API. -## Table of contents - -- [New Office365 provider](#new-office365-provider) -- [Office365.calendar.getCalendar()](#office365calendargetcalendar) -- [Office365.calendar.getCalendars()](#office365calendargetCalendars) -- [Office365.calendar.getEvent()](#office365calendargetevent) -- [Office365.calendar.getEvents()](#office365calendargetevents) -- [Office365.mail.append()](#office365mailappend) -- [Office365.mail.copy()](#office365mailcopy) -- [Office365.mail.createFolder()](#office365mailcreatefolder) -- [Office365.mail.delete()](#office365maildelete) -- [Office365.mail.deleteFolder()](#office365maildeletefolder) -- [Office365.mail.getFolder()](#office365mailgetfolder) -- [Office365.mail.getFolderList()](#office365mailgetfolderlist) -- [Office365.mail.getMail()](#office365mailgetmail) -- [Office365.mail.getMails()](#office365mailgetmails) -- [Office365.mail.move()](#office365mailmove) -- [Office365.mail.renameFolder()](#office365mailrenameFolder) -- [Office365.mail.reply()](#office365mailreply) -- [Office365.mail.send()](#office365mailsend) -- [Office365.mail.update()](#office365mailupdate) -- [Well-known folder names](well-known-folder-names) -- ["Microsoft" mail object properties](#microsoft-mail-object-properties) -- [Status object (Office365 Class)](#status-object) -- [Office365.user.get()](#office365userget) -- [Office365.user.getCurrent()](#office365usergetcurrent) -- [Office365.user.list()](#office365userlist) +## Table of Contents +### [Initialization](##new-office365-provider) +* [New Office365 provider](#new-office365-provider) + +### [Calendar](#calendar) + +* [Office365.calendar.getCalendar()](#office365calendargetcalendar) +* [Office365.calendar.getCalendars()](#office365calendargetcalendars) +* [Office365.calendar.getEvent()](#office365calendargetevent) +* [Office365.calendar.getEvents()](#office365calendargetevents) +* [Office365.calendar.createEvent()](#office365calendarcreateevent) +* [Office365.calendar.updateEvent()](#office365calendarupdateevent) +* [Office365.calendar.deleteEvent()](#office365calendardeleteevent) +* [Office365.category.list()](#office365categorylist) +* [Event object](#event-object) + +### [Mail](#mail) + +* [Office365.mail.send()](#office365mailsend) +* [Office365.mail.append()](#office365mailappend) +* [Office365.mail.update()](#office365mailupdate) +* [Office365.mail.reply()](#office365mailreply) +* [Office365.mail.createFolder()](#office365mailcreatefolder) +* [Office365.mail.renameFolder()](#office365mailrenamefolder) +* [Office365.mail.deleteFolder()](#office365maildeletefolder) +* [Office365.mail.getFolder()](#office365mailgetfolder) +* [Office365.mail.getFolderList()](#office365mailgetfolderlist) +* [Office365.mail.getMail()](#office365mailgetmail) +* [Office365.mail.getMails()](#office365mailgetmails) +* [Office365.mail.move()](#office365mailmove) +* [Office365.mail.copy()](#office365mailcopy) +* [Office365.mail.delete()](#office365maildelete) +* [Well-known folder names](#well-known-folder-names) +* ["Microsoft" mail object properties](#microsoft-mail-object-properties) + +### [User](#user) + +* [Office365.user.get()](#office365userget) +* [Office365.user.getCurrent()](#office365usergetcurrent) +* [Office365.user.list()](#office365userlist) + +### [Status](#status-object) + +* [Status object (Office365 Class)](#status-object) ## **New Office365 provider** @@ -98,6 +115,8 @@ $office365:=New Office365 provider($oAuth2;New object("mailType"; "Microsoft")) Refer to [this tutorial](#authenticate-to-the-microsoft-graph-api-in-service-mode) for an example of connection in Service mode. +## Calendar + ### Office365.calendar.getCalendar() **Office365.calendar.getCalendar**({*id*: Text}) : Object @@ -294,11 +313,308 @@ var $myCaldendar:=$calendars.calendars[0] var $events:=$office365.calendar.getEvents({calendarId: $myCalendar.id; top: 10}) ``` -## Office365.mail.append() +### Office365.calendar.createEvent() + +**Office365.calendar.createEvent**(*event*: Object ) : Object + +#### Parameters + +| Parameter | Type | | Description | +| --------- | ---- |---|------------------------- | +| event | Object | -> | Object containing details of the calendar [event](#event-object) to create | +| result| Object | <- | [Status object](#status-object-microsoft-class)| + +#### Description + +`Office365.calendar.createEvent()` creates a new calendar event. + +#### Returned Object + +The method returns a [**status object**](#status-object-microsoft-class) with an additional `event` property: + +| Property | Type | Description| +| -------- | ---------- | ----------------------------------- | +| event| Object | Event object returned by the server | +| success | Boolean| See [Status object](#status-object-microsoft-class) | +| statusText | Text| See [Status object](#status-object-microsoft-class) | +| errors | Collection | See [Status object](#status-object-microsoft-class) | + +#### Permissions + +One of the following permissions is required to create an event: + +| Type | Permission | +| ----------------------- | --------------------- | +| Delegated (Work/School) | `Calendars.ReadWrite` | +| Delegated (Personal) | `Calendars.ReadWrite` | +| Application | `Calendars.ReadWrite` | + +#### Example + +Create a calendar event: + +```4d +var $Office365 : cs.NetKit.Microsoft +var $event; $result : Object + +$event:=New object +$event.subject:="Team Sync" +$event.start:=New object +$event.start.dateTime:="2025-06-15T09:00:00" +$event.start.timeZone:="Europe/Paris" +$event.end:=New object +$event.end.dateTime:="2025-06-15T10:00:00" +$event.end.timeZone:="Europe/Paris" + +$result:=$Office365.calendar.createEvent($event) +If (Not($result.success)) + ALERT($result.statusText) +End if +``` +### Office365.calendar.updateEvent() + +**Office365.calendar.updateEvent**(*event*: Object) : Object + +#### Parameters + +| Parameter | Type | | Description| +| --------- | ------ | ---- | ----------------------------- | +| event | Object | ->| Object containing the complete updated [event](#event-object). | +| Result| Object | <-| [Status object](#status-object-office365-class)| + +#### Description + +`Office365.calendar.updateEvent()` updates an existing calendar event. + +> **Notes**: +> When using `Office365.calendar.updateEvent()`, you only need to include the fields you want to update. +> Any property you leave out will keep its current value, unless it needs to be recalculated due to changes in related fields (e.g., updating recurrence may affect dates). + +You can update the following properties: + +| Property | Description| +| ---------------------------- | --------------------------- | +|attendees| List of people invited to the event | +|body | Event description or message content | +|categories| Tags or labels assigned to the event | +|end| End date and time of the event | +|hideAttendees| If `true`, attendees can't see each other | +|importance | Level of importance (`low`, `normal`, `high`) | +|isAllDay| Whether the event lasts the entire day | +|isOnlineMeeting| Enables online meeting support | +|isReminderOn| Turns reminders on or off | +|location| Main location of the event | +|locations| List of additional locations | +|onlineMeetingProvider| Provider used (e.g., Teams, Skype)| +|recurrence| Recurrence pattern (e.g., daily, weekly) | +|reminderMinutesBeforeStart| Time before start to trigger reminder| +|responseRequested| Whether responses are expected from attendees| +|sensitivity | Event sensitivity (`normal`, `private`, etc.) | +|showAs| Availability status (`busy`, `free`, etc.) | +|start | Start date and time of the event | +|subject| Event title | + +#### Returned Object + +The method returns a [**status object**](#status-object-office365-class) with an additional `event` property: + +| Property | Type | Description | +| ---------- | ---------- | --------------------------------------------------- | +| event | Object | Updated event object returned by the server | +| success | Boolean | [see Status object](#status-object-office365-class) | +| statusText | Text | [see Status object](#status-object-office365-class) | +| errors | Collection | [see Status object](#status-object-office365-class) | + +#### Permissions + +One of the following permissions is required to update an event: + +| Type | Permission | +| ----------------------- | --------------------- | +| Delegated (Work/School) | `Calendars.ReadWrite` | +| Delegated (Personal) | `Calendars.ReadWrite` | +| Application | `Calendars.ReadWrite` | + +#### Example + +Update an already existing event calendar: + +```4d +#DECLARE ($event : Object) + +var $Office365 : cs.NetKit.Office365 +var $result : Object + +$event.subject:="Updated Meeting Title" +$event.start:=New object +$event.start.dateTime:="2025-06-15T11:00:00" +$event.start.timeZone:="UTC" +$event.end:=New object +$event.end.dateTime:="2025-06-15T12:00:00" +$event.end.timeZone:="UTC" + +$result:=$Office365.calendar.updateEvent($event) +If (Not($result.success)) + ALERT($result.statusText) +End if +``` + +### Office365.calendar.deleteEvent() + +**Office365.calendar.deleteEvent**(*param*: Object) : Object + +#### Parameters + +| Parameter | Type | Direction | Description | +| --------- | ------ | --------- | ------------------------------------------------------------------------------------------------------------------- | +| param | Object | -> | Object containing details for the calendar [event](#event-object) to delete| +| Result | Object | <- | [Status object](#status-object-office365-class) | + +#### Description + +`Office365.calendar.deleteEvent()` deletes a calendar event. + +In *param*, you can pass the following properties: + +| Property | Type | Description | +| ----------- | ---- | ---------------------------------------- | +| eventId | Text | **Required.** ID of the event to delete. | +| calendarId | Text | ID of the calendar. If not provided, the primary calendar of the currently logged-in user is used. | + + +#### Returned Object + +The method returns a [**status object**](#status-object-office365-class). + +#### Permissions + +One of the following permissions is required to delete an event: + +| Type | Permission | +| ----------------------- | --------------------- | +| Delegated (Work/School) | `Calendars.ReadWrite` | +| Delegated (Personal) | `Calendars.ReadWrite` | +| Application | `Calendars.ReadWrite` | + +#### Example + +Delete a calendar event: + +```4d +$status:=$office365.calendar.deleteEvent({eventId: $event.event.id}) +``` + +### Office365.category.list() + +**Office365.category.list**() : Object + +#### Parameters + +| Parameter | Type | | Description | +| --------- | ------ | -- | ------------------------------------------------------------------ | +| This method does not take any parameters.| | | | +| Result | Object | <- | [Status object](#status-object) including a `categories` property. | + +#### Description + +`Office365.category.list()` retrieves the list of defined categories used to group and organize items such as messages and calendar events in a Microsoft account. + +Each category includes a display name and a color, which can be applied when creating or updating events. + +#### Returned Object + +The method returns a [**status object**](#status-object) with an additional `categories` property: + +| Property | | Type | Description | +| --------- | --|-------- | ----------------------------- | +| success | | Boolean | [See Status object](#status-object) | +| statusText | | Text | [See Status object](#status-object) | +| errors | | Collection | [See Status object](#status-object) | +| categories | | Collection | Collection of category objects. | +| | id | Text | ID of the category. | +| | displayName | Text | A unique name that identifies the category in the user's mailbox. Once set, this name cannot be changed. | +| | color | Text | A pre-set color constant mapped to one of 25 predefined Outlook colors (e.g., `"Preset0"`, `"Preset12"`). See the list of [color constants](https://learn.microsoft.com/en-us/graph/api/resources/outlookcategory?view=graph-rest-1.0#properties) for more details. | + +#### Permissions + +One of the following permissions is required: + +| Type | Permission | +| ----------------------- | ---------------------- | +| Delegated (Work/School) | `MailboxSettings.Read` | +| Delegated (Personal) | `MailboxSettings.Read` | +| Application | `MailboxSettings.Read` | + +#### Example + +```4d + +var $o365 : cs.NetKit.Office365 +var $result : Object +ARRAY TEXT($toDisplay; 0) + +$result:=$o365.category.list() +If (Not($result.success)) + ALERT($result.statusText) +Else + // Process the category list + For each ($category; $result.categories) + APPEND TO ARRAY($toDisplay; $category.displayName) + End for each +End if +``` + +### Event object + +The `event` object used with Microsoft Calendar methods includes the following properties: + +| Property | | Type | Description| +| -------- | -- | ----- | ----------------------- | +| id | | Text | ID for the event. Case-sensitive and read-only. May change if the event is moved to another calendar or folder. Use [`Prefer: IdType="ImmutableId"`](https://learn.microsoft.com/en-us/graph/outlook-immutable-id) to preserve it. | +| calendarId | | Text | Calendar ID. If not provided, the user's primary calendar is used. | +| attachments| | Collection | Event file attachments.| +| attendees | | Collection | List of attendees.| +| | emailAddress | Text | **Required.** Attendee’s email address.| +| | type | Text | Attendee role: `"required"`, `"optional"`, or `"resource"`.| +| body | | Object |Body of the message associated with the event.| +| | content | Text | Content of the body| +| | contentType | Text | Type of the content.
Possible values:`"text"` or `"html"`.| +| categories | | Collection | List of categories associated with the event. Must match the `displayName` of categories returned by `Office365.category.list()`. | +| start | | Object | Start time of the event.| +| | date | Date | Start time of the event. If provided as text, use the format `"yyyy-mm-dd"`.| +| | time | Time| Start time (not used for all-day events).| +| | dateTime | Text | Combined start date and time (`"yyyy-mm-ddThh:mm:ss"` format). Overrides `date` and `time`. | +| | timeZone | Text | Time zone for the `dateTime`, using IANA format (e.g., `"Europe/Zurich"`). Defaults to UTC if not provided.| +| end | | Object | End time of the event.| +| | date | Date | End date of the event. If provided as text, use the format `"yyyy-mm-dd"`.| +| | time | Time | End time (not used for all-day events).| +| | dateTime | Text | Combined end date and time (`"yyyy-mm-ddThh:mm:ss"` format). Overrides `date` and `time`.| +| | timeZone | Text | Time zone for the `dateTime`, using IANA format (e.g., `"Europe/Zurich"`). Defaults to UTC if not provided.| +| isAllDay | | Boolean | (Default: false) Set to `true` if it's an all-day event.| +| isDraft | | Boolean |(Default: false) Set to `true` if changes have been made to the meeting but not yet sent to attendees.| +| isCancelled | | Boolean | (Default: false) Whether the event is canceled.| +| isReminderOn| | Boolean | (Default: false) Whether a reminder is set for the event.| +| isOnlineMeeting | | Boolean | (Default: false) Set to `true` to create an online meeting. Once set, the event stays online and further changes to this setting are ignored.| +| onlineMeetingProvider | | Text | Provider used: `"teamsForBusiness"`, `"skypeForBusiness"`, `"skypeForConsumer"`, etc.| +| location | | Object | Event [location object](https://learn.microsoft.com/en-us/graph/api/resources/location?view=graph-rest-1.0).| +| reminderMinutesBeforeStart | | Integer | Time in minutes before start to trigger reminder.| +| responseRequested | | Boolean | Whether a response is requested from attendees. Default is `true`.| +| recurrence | | Object | Recurrence pattern (e.g., daily, weekly) .| +| seriesMasterId | | Text | ID of the recurring series master event, if this event is part of a recurring series. | +| importance | | Text | Event importance: `"low"`, `"normal"`, or `"high"`.| +| sensitivity | | Text | Event sensitivity: `"normal"`, `"personal"`, `"private"`, `"confidential"`.| +| showAs| | Text | Availability status: `busy`, `free`, etc.| +| subject | | Text | Event title or subject line.| +| allowNewTimeProposals | | Boolean | (Default: true) Whether attendees can propose a new time.| +| hideAttendees | | Boolean | (Default: false) If `true`, attendees will only see themselves.| + +## Mail + +### Office365.mail.append() **Office365.mail.append**( *email* : Object ; *folderId* : Text) : Object -### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| @@ -306,18 +622,18 @@ var $events:=$office365.calendar.getEvents({calendarId: $myCalendar.id; top: 10} |folderId|Text|->| Id of the destination folder. Can be a folder id or a [Well-known folder name](#well-known-folder-name).| |Result|Object|<-| [Status object](#status-object) | -### Description +#### Description `Office365.mail.append()` creates a draft *email* in the *folderId* folder. In `email`, pass the email to create. It must be of the [Microsoft mail object](#microsoft-mail-object-properties) type. -### Returned object +#### Returned object The method returns a [status object](#status-object). -### Permissions +#### Permissions One of the following permissions is required to call this API. For more information, including how to choose permissions, see the [Permissions section on the Microsoft documentation](https://docs.microsoft.com/en-us/graph/permissions-reference). @@ -328,18 +644,18 @@ One of the following permissions is required to call this API. For more informat |Application|Mail.ReadWrite| -### Example +#### Example ```4d $status:=$office365.mail.append($draft; $folder.id) ``` -## Office365.mail.copy() +### Office365.mail.copy() **Office365.mail.copy**( *mailId* : Text ; *folderId* : Text) : Object -### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| @@ -347,15 +663,15 @@ $status:=$office365.mail.append($draft; $folder.id) |folderId|Text|->| Id of the destination folder. Can be a folder id or a [Well-known folder name](#well-known-folder-name).| |Result|Object|<-| [Status object](#status-object) | -### Description +#### Description `Office365.mail.copy()` copies the *mailId* email to the *folderId* folder within the user's mailbox. -### Returned object +#### Returned object The method returns a [status object](#status-object). -### Permissions +#### Permissions One of the following permissions is required to call this API. For more information, including how to choose permissions, see the [Permissions section on the Microsoft documentation](https://docs.microsoft.com/en-us/graph/permissions-reference). @@ -365,7 +681,7 @@ One of the following permissions is required to call this API. For more informat |Delegated (personal Microsoft account)|Mail.ReadWrite| |Application|Mail.ReadWrite| -### Example +#### Example To copy an email from a folder to another: @@ -374,11 +690,11 @@ $status:=$office365.mail.copy($mailId; $folderId) ``` -## Office365.mail.createFolder() +### Office365.mail.createFolder() **Office365.mail.createFolder**( *name* : Text { ; *isHidden* : Boolean { ; *parentFolderId* : Text } }) : Object -### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| @@ -393,7 +709,7 @@ By default, the new folder is not hidden. Pass `True` in the isHidden parameter By default, the new folder is created at the root folder of the mailbox. If you want to create it within an existing folder, pass its id in the *parentFolderId* parameter. -### Permissions +#### Permissions One of the following permissions is required to call this API. For more information, including how to choose permissions, see the [Permissions section on the Microsoft documentation](https://docs.microsoft.com/en-us/graph/permissions-reference). @@ -404,11 +720,11 @@ One of the following permissions is required to call this API. For more informat |Application|Mail.ReadWrite| -### Returned object +#### Returned object The method returns a [status object](#status-object). -### Example +#### Example You want to create a "Backup" mail folder at the root of your mailbox and move an email to this folder: @@ -422,23 +738,23 @@ If($status.success=True) End if ``` -## Office365.mail.delete() +### Office365.mail.delete() **Office365.mail.delete**( *mailId* : Text ) : Object -### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| |mailId|Text|->| Id of the mail to delete| |Result|Object|<-| [Status object](#status-object) | -### Description +#### Description `Office365.mail.delete()` deletes the *mailId* email. -### Permissions +#### Permissions One of the following permissions is required to call this API. For more information, including how to choose permissions, see the [Permissions section on the Microsoft documentation](https://docs.microsoft.com/en-us/graph/permissions-reference). @@ -450,7 +766,7 @@ One of the following permissions is required to call this API. For more informat |Application|Mail.ReadWrite| -### Returned object +#### Returned object The method returns a [status object](#status-object). @@ -458,7 +774,7 @@ The method returns a [status object](#status-object). **Note:** You may not be able to delete items in the recoverable items deletions folder (for more information, see the [Microsoft's documentation website](https://learn.microsoft.com/en-us/graph/api/message-delete?view=graph-rest-1.0&tabs=http)). -### Example +#### Example You want to delete all mails in the *$mails* collection: @@ -468,22 +784,22 @@ For each($mail;$mails) End for each ``` -## Office365.mail.deleteFolder() +### Office365.mail.deleteFolder() **Office365.mail.deleteFolder**( *folderId* : Text ) : Object -### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| |folderId|Text|->| ID of the folder to delete. Can be a folder id or a [Well-known folder name](#well-known-folder-name) if one exists.| |Result|Object|<-| [Status object](#status-object) | -### Description +#### Description `Office365.mail.deleteFolder()` deletes the *folderId* mail folder. -### Permissions +#### Permissions One of the following permissions is required to call this API. For more information, including how to choose permissions, see the [Permissions section on the Microsoft documentation](https://docs.microsoft.com/en-us/graph/permissions-reference). @@ -494,21 +810,21 @@ One of the following permissions is required to call this API. For more informat |Application|Mail.ReadWrite| -### Returned object +#### Returned object The method returns a [status object](#status-object). -### Example +#### Example ```4d $status:=$office365.mail.deleteFolder($folderId) ``` -## Office365.mail.getFolder() +### Office365.mail.getFolder() **Office365.mail.getFolder**( *folderId* : Text ) : Object -### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| @@ -517,7 +833,7 @@ $status:=$office365.mail.deleteFolder($folderId) `Office365.mail.getFolder()` allows you to get a **mailFolder** object from its *folderId*. -### Permissions +#### Permissions One of the following permissions is required to call this API. For more information, including how to choose permissions, see the [Permissions section on the Microsoft documentation](https://docs.microsoft.com/en-us/graph/permissions-reference). @@ -528,7 +844,7 @@ One of the following permissions is required to call this API. For more informat |Application|Mail.ReadBasic.All, Mail.Read, Mail.ReadWrite| -### mailFolder object +#### mailFolder object The method returns a **mailFolder** object containing the following properties (additional information can be returned by the server): @@ -543,11 +859,11 @@ The method returns a **mailFolder** object containing the following properties ( |unreadItemCount|Integer|Number of items in the mailFolder marked as unread.| -## Office365.mail.getFolderList() +### Office365.mail.getFolderList() **Office365.mail.getFolderList**( *options* : Object ) : Object -### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| @@ -569,7 +885,7 @@ In *options*, pass an object to define the folders to get. The available propert |includeHiddenFolders|boolean|True to include hidden folders in the response. False (default) to not return hidden folders. | -### Permissions +#### Permissions One of the following permissions is required to call this API. For more information, including how to choose permissions, see the [Permissions section on the Microsoft documentation](https://docs.microsoft.com/en-us/graph/permissions-reference). @@ -580,7 +896,7 @@ One of the following permissions is required to call this API. For more informat |Application|Mail.ReadBasic.All, Mail.Read, Mail.ReadWrite| -### Returned object +#### Returned object The method returns a status object containing the following properties: @@ -610,7 +926,7 @@ The method returns an empty collection in the `folders` property if: - no folders are found at the defined location - an error is thrown -### Example +#### Example You want to : @@ -625,11 +941,11 @@ $subfolders:=$office365.mail.getFolderList($result.folders[8].id) ``` -## Office365.mail.getMail() +### Office365.mail.getMail() **Office365.mail.getMail**( *mailId* : Text { ; *options* : Object } ) : Object
**Office365.mail.getMail**( *mailId* : Text { ; *options* : Object } ) : Blob -### Parameters +#### Parameters |Parameter||Type||Description| |-----|----|--- |:---:|------| @@ -657,7 +973,7 @@ If an error occurs, the function returns Null and an error is generated. See also [Microsoft's documentation website](https://learn.microsoft.com/en-us/graph/api/message-get?view=graph-rest-1.0&tabs=http). -### Permissions +#### Permissions One of the following permissions is required to call this API. For more information, including how to choose permissions, see the [Permissions section on the Microsoft documentation](https://docs.microsoft.com/en-us/graph/permissions-reference). @@ -668,7 +984,7 @@ One of the following permissions is required to call this API. For more informat |Application|Mail.ReadBasic.All, Mail.Read| -### Example +#### Example Download a specific email: @@ -677,11 +993,11 @@ $mail:=$office.mail.getMail($mailId) ``` -## Office365.mail.getMails() +### Office365.mail.getMails() **Office365.mail.getMails**( *options* : Object ) : Object -### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| @@ -704,7 +1020,7 @@ In *options*, pass an object to define the mails to get. The available propertie |orderBy|text|Defines how returned items are ordered. Default is ascending order. Syntax: "fieldname asc" or "fieldname desc" (replace "fieldname" with the name of the field to be arranged).| -### Returned object +#### Returned object The method returns a status object containing the following properties: @@ -722,7 +1038,7 @@ The method returns a status object containing the following properties: | success | | Boolean | `True` if the `Office365.mail.getFolderList()` call is successful, `False` otherwise | | mails || Collection | Collection of [Microsoft mail objects](#microsoft-mail-object-properties). If no mail is returned, the collection is empty| -### Permissions +#### Permissions One of the following permissions is required to call this API. For more information, including how to choose permissions, see the [Permissions section on the Microsoft documentation](https://docs.microsoft.com/en-us/graph/permissions-reference). @@ -732,7 +1048,7 @@ One of the following permissions is required to call this API. For more informat |Delegated (personal Microsoft account)|Mail.ReadBasic, Mail.Read, Mail.ReadWrite| |Application|Mail.ReadBasic.All, Mail.Read, Mail.ReadWrite| -### Example +#### Example You want to retrieve *sender* and *subject* properties of all the mails present in the Inbox folder, using its [well-known folder name](#well-known-folder-name): @@ -744,11 +1060,11 @@ $param.select:="sender,subject" $mails:=$office365.mail.getMails($param) ``` -## Office365.mail.move() +### Office365.mail.move() **Office365.mail.move**( *mailId* : Text ; *folderId* : Text) : Object -### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| @@ -756,16 +1072,16 @@ $mails:=$office365.mail.getMails($param) |folderId|Text|->| Id of the destination folder. Can be a folder id or a [Well-known folder name](#well-known-folder-name).| |Result|Object|<-| [Status object](#status-object) | -### Description +#### Description `Office365.mail.move()` moves the *mailId* email to the *folderId* folder. It actually creates a new copy of the email in the destination folder and removes the original email from its source folder. -### Returned object +#### Returned object The method returns a [status object](#status-object). -### Permissions +#### Permissions One of the following permissions is required to call this API. For more information, including how to choose permissions, see the [Permissions section on the Microsoft documentation](https://docs.microsoft.com/en-us/graph/permissions-reference). @@ -776,7 +1092,7 @@ One of the following permissions is required to call this API. For more informat |Application|Mail.ReadWrite| -### Example +#### Example To move an email from a folder to another: @@ -784,11 +1100,11 @@ To move an email from a folder to another: $status:=$office365.mail.move($mailId; $folderId) ``` -## Office365.mail.renameFolder() +### Office365.mail.renameFolder() **Office365.mail.renameFolder**( *folderId* : Text ; *name* : Text ) : Object -### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| @@ -796,13 +1112,13 @@ $status:=$office365.mail.move($mailId; $folderId) |name|Text|->| New display name for the folder| |Result|Object|<-| [Status object](#status-object) | -### Description +#### Description `Office365.mail.renameFolder()` renames the *folderId* mail folder with the provided *name*. Note that the renamed folder ID is different from the *folderId*. You can get it in the returned [status object](#status-object). -### Permissions +#### Permissions One of the following permissions is required to call this API. For more information, including how to choose permissions, see the [Permissions section on the Microsoft documentation](https://docs.microsoft.com/en-us/graph/permissions-reference). @@ -813,11 +1129,11 @@ One of the following permissions is required to call this API. For more informat |Application|Mail.ReadWrite| -### Returned object +#### Returned object The method returns a [status object](#status-object). -### Example +#### Example You want to rename the the "Backup" folder to "Backup_old": @@ -826,11 +1142,11 @@ $status:=$office365.mail.renameFolder($folderId; "Backup_old") ``` -## Office365.mail.reply() +### Office365.mail.reply() **Office365.mail.reply**( *reply* : Object ; *mailId* : Text { ; *replyAll* : Boolean } ) : Object -### Parameters +#### Parameters |Parameter||Type||Description| |----|-----|--- |:---:|------| @@ -841,7 +1157,7 @@ $status:=$office365.mail.renameFolder($folderId; "Backup_old") |replyAll||Boolean|->| True to reply to all recipients of the message. Default=False| |Result|Object|<-| [Status object](#status-object) | -### Description +#### Description `Office365.mail.reply()` replies to the sender of *mailId* message and, optionnally, to all recipients of the message. @@ -849,11 +1165,11 @@ $status:=$office365.mail.renameFolder($folderId; "Backup_old") If you pass `False` in *replyAll* and if the original message specifies a recipient in the `replyTo` property, the reply is sent to the recipients in `replyTo` and not to the recipient in the `from` property. -### Returned object +#### Returned object The method returns a [status object](#status-object) -### Permissions +#### Permissions One of the following permissions is required to call this API. For more information, including how to choose permissions, see the [Permissions section on the Microsoft documentation](https://docs.microsoft.com/en-us/graph/permissions-reference). @@ -863,7 +1179,7 @@ One of the following permissions is required to call this API. For more informat |Delegated (personal Microsoft account)|Mail.Send| |Application|Mail.Send| -### Example +#### Example To reply to an email and create a conversation: @@ -876,18 +1192,18 @@ $status:=$office365.mail.reply($reply; $mails.mailId) -## Office365.mail.send() +### Office365.mail.send() **Office365.mail.send**( *email* : Text ) : Object
**Office365.mail.send**( *email* : Object ) : Object
**Office365.mail.send**( *email* : Blob ) : Object -### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| |email|Text | Blob | Object|->| Email to be sent| |Result|Object|<-| [Status object](#status-object) | -### Description +#### Description `Office365.mail.send()` sends an email using the MIME or JSON formats. @@ -909,15 +1225,15 @@ $status:=$Office365.mail.send($email) > To avoid authentication errors, make sure your application asks for permission to send emails through the Microsoft Graph API. See [Permissions](https://docs.microsoft.com/en-us/graph/api/user-sendmail?view=graph-rest-1.0&tabs=http#permissions). -### Returned object +#### Returned object The method returns a [status object](#status-object). -## Office365.mail.update() +### Office365.mail.update() **Office365.mail.update**( *mailId* : Text ; *updatedFields* : Object ) : Object -### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| @@ -925,7 +1241,7 @@ The method returns a [status object](#status-object). |updatedFields|Object|->|email fields to update| |Result|Object|<-| [Status object](#status-object) | -### Description +#### Description `Office365.mail.update()` allows you to update various properties of received or drafted emails. @@ -955,17 +1271,17 @@ In *updatedFields*, you can pass several properties: * Existing properties that are not included in the *updatedFields* object will maintain their previous values or be recalculated based on changes to other property values. * Specific properties, such as the body or subject, can only be updated for emails in draft status (isDraft = true). -### Returned object +#### Returned object The method returns a [status object](#status-object). -## Well-known folder names +### Well-known folder names Outlook creates certain folders for users by default. Instead of using the corresponding `folder id` value, for convenience, you can use the well-known folder name when accessing these folders. Well-known names work regardless of the locale of the user's mailbox. For example, you can get the Drafts folder using its well-known name "draft". For more information, please refer to the [Microsoft Office documentation](https://docs.microsoft.com/en-us/graph/api/resources/mailfolder?view=graph-rest-1.0). -## "Microsoft" mail object properties +### "Microsoft" mail object properties When you send an email with the "Microsoft" mail type, you must pass an object to `Office365.mail.send()`. For a comprehensive list of properties supported by Microsoft mail objects, please refer to the [Microsoft Office documentation](https://learn.microsoft.com/en-us/graph/api/resources/message?view=graph-rest-1.0#properties). Most common properties are listed below: @@ -987,7 +1303,7 @@ When you send an email with the "Microsoft" mail type, you must pass an object t | subject |Text| The subject of the message.| | toRecipients |[recipient](#recipient-object) collection | The To: recipients for the message. | -### Attachment object +#### Attachment object | Property | Type | Description | |---|---|---| @@ -1001,14 +1317,14 @@ When you send an email with the "Microsoft" mail type, you must pass an object t |size|Number|The size in bytes of the attachment.| |getContent()|Function|Returns the contents of the attachment object in a `4D.Blob` object.| -### itemBody object +#### itemBody object | Property | Type | Description | Can be null of undefined | |---|---|---|---| |content|Text|The content of the item.|No| |contentType|Text| The type of the content. Possible values are `"text"` and `"html"` |No| -### recipient object +#### recipient object | Property || Type | Description | Can be null of undefined | |---|---|---|---|---| @@ -1016,14 +1332,14 @@ When you send an email with the "Microsoft" mail type, you must pass an object t ||address|Text|The email address of the person or entity.|No| ||name|Text| The display name of the person or entity.|Yes| -### internetMessageHeader object +#### internetMessageHeader object | Property | Type | Description | Can be null of undefined | |---|---|---|---| |name | Text|Represents the key in a key-value pair.|No| |value|Text|The value in a key-value pair.|No| -### followup flag object +#### followup flag object | Property | Type | Description | |---|---|---| @@ -1031,7 +1347,7 @@ When you send an email with the "Microsoft" mail type, you must pass an object t |flagStatus|Text|The status for follow-up for an item. Possible values are `"notFlagged"`, `"complete"`, and `"flagged"`.| |startDateTime|[dateTime | TimeZone](#datetime-and-timezone)| The date and time that the follow-up is to begin.| -### dateTime and TimeZone +#### dateTime and TimeZone |Property|Type|Description| |---|---|---| @@ -1044,7 +1360,7 @@ In general, the timeZone property can be set to any of the time zones currently -### Example: Create an email with a file attachment and send it +#### Example: Create an email with a file attachment and send it Send an email with an attachment, on behalf of a Microsoft 365 user: @@ -1091,7 +1407,7 @@ $Office365:=New Office365 provider($token; New object("mailType"; "Microsoft")) $status:=$Office365.mail.send($email) ``` -### Status object +## Status object Several Office365.mail functions return a standard `**status object**`, containing the following properties: @@ -1105,20 +1421,20 @@ Several Office365.mail functions return a standard `**status object**`, containi Basically, you can test the `success` and `statusText` properties of this object to know if the function was correctly executed. -### Error handling +#### Error handling When an error occurs during the execution of an Office365.mail function: - if the function returns a [`**status object**`](#status-object), the error is handled by the status object and no error is thrown, - if the function does not return a **status object**, an error is thrown that you can intercept with a project method installed with `ON ERR CALL`. - - -## Office365.user.get() +## User + +### Office365.user.get() **Office365.user.get**( *id* : Text { ; *select* : Text }) : Object
**Office365.user.get**( *userPrincipalName* : Text { ; *select* : Text }) : Object -### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| @@ -1127,7 +1443,7 @@ When an error occurs during the execution of an Office365.mail function: |select|Text|->| Set of properties to be returned| |Result|Object|<-| Object holding information on the user| -### Description +#### Description `Office365.user.get()` returns information on the user whose ID matches the *id* parameter, or whose User Principal Name (UPN) matches the *userPrincipalName* parameter. @@ -1140,7 +1456,7 @@ In *select*, you can pass a string that contains a specific set of properties yo > The list of available properties is available on [Microsoft's documentation website](https://docs.microsoft.com/en-us/graph/api/resources/user?view=graph-rest-1.0). -### Returned object +#### Returned object By default, if the *select* parameter is omitted, the command returns an object with the following properties: @@ -1162,11 +1478,11 @@ Otherwise, the object contains the properties specified in the `select` paramete For more details on user information, see [Microsoft's documentation website](https://docs.microsoft.com/en-us/graph/api/resources/user?view=graph-rest-1.0). -## Office365.user.getCurrent() +### Office365.user.getCurrent() **Office365.user.getCurrent**({*select* : Text}) : Object -### Description +#### Description `Office365.user.getCurrent()` returns information on the current user. In this case, it requires a [signed-in user](https://docs.microsoft.com/en-us/graph/auth-v2-user), and therefore a delegated permission. @@ -1176,7 +1492,7 @@ In *select*, pass a string that contains a set of properties you want to retriev By default, if the *select* parameter is not defined, the command returns an object with a default set of properties (see the [property table](#returned-object)). -### Example +#### Example To retrieve information from the current user: @@ -1202,18 +1518,18 @@ $userInfo:=$Office365.user.getCurrent("id,userPrincipalName,\ principalName,displayName,givenName,mail") ``` -## Office365.user.list() +### Office365.user.list() **Office365.user.list**({*options*: Object}) : Object -### Parameters +#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| |options|Object|->| Additional options for the search| |result|Object|<-| Object holding a collection of users and additional info on the request| -### Description +#### Description `Office365.user.list()` returns a list of Office365 users. @@ -1227,7 +1543,7 @@ In *options*, you can pass an object to specify additional search options. The f |top| Integer | Defines the page size for a request. Maximum value is 999. If `top` is not defined, the default value is applied (100). When a result set spans multiple pages, you can use the `.next()` function to ask for the next page. See [Microsoft's documentation on paging](https://docs.microsoft.com/en-us/graph/paging) for more information. | |orderBy| Text | Defines how the returned items are ordered. By default, they are arranged in ascending order. The syntax is "fieldname asc" or "fieldname desc". Replace "fieldname" with the name of the field to be arranged. | -### Returned object +#### Returned object The returned object holds a collection of users as well as status properties and functions that allow you to navigate between different pages of results. @@ -1245,7 +1561,7 @@ By default, each user object in the collection has the [default set of propertie | users | Collection | Collection of objects with information on users.| -### Example +#### Example ```4d var $oAuth2 : cs.NetKit.OAuth2Provider From 7ef3c7786ae71161d7084a78ab0c486a9fab1dee Mon Sep 17 00:00:00 2001 From: mouna-elmaazouzi Date: Wed, 11 Jun 2025 13:52:22 +0100 Subject: [PATCH 02/26] Update Google.md --- docs/Google.md | 87 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 85 insertions(+), 2 deletions(-) diff --git a/docs/Google.md b/docs/Google.md index 1f9f39e..b0b7731 100644 --- a/docs/Google.md +++ b/docs/Google.md @@ -424,7 +424,7 @@ And in *option*, you can pass the following additional optional properties: | Property | Type | Description | |------------|---------|-------------| | sendUpdates | String | Defines who should receive email notifications about the update. Acceptable values:
• `"all"` – Notify all attendees.
• `"externalOnly"` – Notify only non-Google users.
• `"none"` – No notifications sent. | -| supportsAttachments | Boolean | Indicates whether the API client supports attachments. Must be `true` to modify the `attachments` property. Defaults to `false`. | +| supportsAttachments | Boolean | Indicates whether the API client supports attachments. Must be `true` to modify the [`attachments`](#attachment-object-google) property. Defaults to `false`. | | fullUpdate | Boolean | If `true`, the full event is replaced. If `false` (default), only specified fields are updated. | > **Note:** This method replaces the entire event with the data you send. To avoid losing information, always include required fields like `start` and `end`. @@ -506,7 +506,7 @@ The `event` object used with Google Calendar methods includes the following prop | Property | | Type | Description| | ------ |---| -------- | ------------------- | | calendarId | | Text | Calendar ID. If not provided, the user's primary calendar is used. Use `Google.calendar.getCalendars()` to retrieve IDs.| -| attachments | | Collection | File attachments (max 25). To use this, `supportsAttachments` must be set to `true` in the request.| +| attachments | | Collection | File [attachments](#attachment-object-google) (max 25). To use this, `supportsAttachments` must be set to `true` in the request.| | attendees| | Collection | List of attendees. | | | email | String | **Required.** Email address of the attendee. | | | displayName | String | Name of the attendee. | @@ -1045,6 +1045,89 @@ $status:=$google.mail.updateLabel($labelId; {name:"Backup January"}) ``` +### "Google" mail object properties + +When you send an email with the "Google" mail type, you must pass an object to `Google.mail.send()`. For a comprehensive list of properties supported by Gmail message objects, refer to the [Gmail API documentation](https://developers.google.com/gmail/api/reference/rest/v1/users.messages). The most common properties are listed below: + +| Property | Type | Description | +|----------|------|-------------| +| attachments | attachment collection | The attachments for the email. | +| bccRecipients | recipient collection | The Bcc: recipients for the message. | +| ccRecipients | recipient collection | The Cc: recipients for the message. | +| from | recipient object | The sender's email address. Must match the authenticated Gmail user. | +| id | Text | Unique identifier for the message. | +| important | Boolean | If true, marks the message as important (Gmail only). | +| labelIds | Collection | List of label IDs to apply to the message. | +| replyTo | recipient collection | Email addresses to use when replying. | +| sender | recipient object | The account that generates the message. Same as `from` in most cases. | +| subject | Text | The subject line of the message. | +| toRecipients | recipient collection | The To: recipients for the message. | +| threadId | Text | The ID of the thread to which the message belongs. | + + +#### Attachment object (Google) + +| Property | Type | Description | +|----------|------|-------------| +| filename | Text | The name of the attached file. | +| mailType | Text | Indicates the Mail type to use to send and receive email's attechement. | +| content | Text | The base64-encoded content of the file. | +| size | Number | The size of the file in bytes. | +| isInline | Boolean | Set to true if the attachment is inline (e.g., embedded image). | +| contentId | Text | Content ID for referencing the attachment inline via CID. | + + +#### recipient object + +| Property | Type | Description | +|----------|------|-------------| +| emailAddress | Object | Contains the address and display name. | +| emailAddress.address | Text | The email address of the recipient. | +| emailAddress.name | Text | Display name of the recipient. | + +#### Example: Send an email with a file attachment (Google) + +```4d +var $oAuth2 : cs.NetKit.OAuth2Provider +var $token; $param; $email; $status : Object + +// Set up authentication +$param:=New object() +$param.name:="Google" +$param.permission:="signedIn" +$param.clientId:="your-client-id" // Replace with your client ID +$param.redirectURI:="http://127.0.0.1:50993/authorize/" +$param.scope:="https://www.googleapis.com/auth/gmail.send" + +$oAuth2:=New OAuth2 provider($param) +$token:=$oAuth2.getToken() + +// Create the email, specify the sender and the recipient +$email:=New object() +$email.from:=New object("emailAddress"; New object("address"; "sender@gmail.com")) +$email.toRecipients:=New collection(New object("emailAddress"; New object("address"; "recipient@gmail.com"))) +$email.subject:="Hello from NetKit" +$email.body:=New object("content"; "Hello, World!"; "contentType"; "html") + +// Create an attachment +var $attachment : Object +var $text : Text +$text:="Simple text file" +BASE64 ENCODE($text) +$attachment:=New object +$attachment.filename:="note.txt" +$attachment.mimeType:="text/plain" +$attachment.content:=$text +$email.attachments:=New collection($attachment) + +// Send the email +var $Google : Object +$Google:=New Google($token) +$status:=$Google.mail.send($email) +``` + + + ### labelInfo object Several Google.mail label management methods use a `labelInfo` object, containing the following properties: From bef61be645dd26b08026d99cf6d9aa81455c5e6c Mon Sep 17 00:00:00 2001 From: mouna-elmaazouzi <118451160+mouna-elmaazouzi@users.noreply.github.com> Date: Wed, 11 Jun 2025 14:25:09 +0100 Subject: [PATCH 03/26] Update Google.md --- docs/Google.md | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/docs/Google.md b/docs/Google.md index b0b7731..2658a8b 100644 --- a/docs/Google.md +++ b/docs/Google.md @@ -377,17 +377,19 @@ The method returns a [**status object**](status-object-google-class) with an add Create an event in the Google calendar: ```4d -var $Google : cs.NetKit.Google +var $Google:=cs.NetKit.Google.new($Oauth) var $event; $result : Object -$event:=New object +$event:={}New object $event.summary:="Team Meeting" -$event.start:=New object -$event.start.dateTime:="2025-06-15T09:00:00" -$event.start.timeZone:="Europe/Paris" -$event.end:=New object -$event.end.dateTime:="2025-06-15T10:00:00" -$event.end.timeZone:="Europe/Paris" +$event.start:={]New object +$event.start.date:=Current date +$event.start.time:=Current time +$event.end:={}New object +$event.end.date:=Current date +$event.end.time:=Current time+3600 +$event.attendees:=[{email: "first.lastname@gmail.com"}] +$event.description:="description of the event" $result:=$Google.calendar.createEvent($event) If (Not($result.success)) @@ -445,17 +447,19 @@ The method returns a [**status object**](status-object-google-class) with an add Update an already existing event: ```4d -#DECLARE(event:object) -var $Google : cs.NetKit.Google +#DECLARE($eventId:Text) +var $Google:=cs.NetKit.Google.new($Oauth) var $result : Object +$event.id:=$eventId $event.summary:="Updated Event Title" -$event.start:=New object -$event.start.dateTime:="2025-06-15T11:00:00" -$event.start.timeZone:="Europe/Paris" -$event.end:=New object -$event.end.dateTime:="2025-06-15T12:00:00" -$event.end.timeZone:="Europe/Paris" +$event.description:="Updated Event description" +$event.start:={]New object +$event.start.date:=Current date +$event.start.time:=Current time +$event.end:={}New object +$event.end.date:=Current date +$event.end.time:=Current time+3600 $result:=$Google.calendar.updateEvent($event) If (Not($result.success)) @@ -1368,4 +1372,4 @@ Some functions adds specific properties to the **status object**, properties are ## See also [Office365 Class](./Office365.md)
-[OAuth2Provider Class](./OAuth2Provider.md) \ No newline at end of file +[OAuth2Provider Class](./OAuth2Provider.md) From d7377265fe3bff7e112e887ba04a1ad88b108e16 Mon Sep 17 00:00:00 2001 From: mouna-elmaazouzi <118451160+mouna-elmaazouzi@users.noreply.github.com> Date: Wed, 11 Jun 2025 14:31:27 +0100 Subject: [PATCH 04/26] Update Google.md --- docs/Google.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/Google.md b/docs/Google.md index 2658a8b..8ab5af5 100644 --- a/docs/Google.md +++ b/docs/Google.md @@ -500,7 +500,9 @@ The method returns a standard [**status object**](#status-object-google-class). Delete a calendar event: ```4d -$status:=$google.calendar.deleteEvent({eventId: $event.event.id}) +var $Google:=cs.NetKit.Google.new($Oauth) + +$status:=$google.calendar.deleteEvent({eventId: $event.id}) ``` ### Event object From 6b98a2c6ff8afe4a5fb53ab46d15a098cdf1edbe Mon Sep 17 00:00:00 2001 From: mouna-elmaazouzi <118451160+mouna-elmaazouzi@users.noreply.github.com> Date: Wed, 11 Jun 2025 14:35:54 +0100 Subject: [PATCH 05/26] Update Google.md --- docs/Google.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/Google.md b/docs/Google.md index 8ab5af5..e188074 100644 --- a/docs/Google.md +++ b/docs/Google.md @@ -380,12 +380,12 @@ Create an event in the Google calendar: var $Google:=cs.NetKit.Google.new($Oauth) var $event; $result : Object -$event:={}New object +$event:={} $event.summary:="Team Meeting" -$event.start:={]New object +$event.start:={] $event.start.date:=Current date $event.start.time:=Current time -$event.end:={}New object +$event.end:={} $event.end.date:=Current date $event.end.time:=Current time+3600 $event.attendees:=[{email: "first.lastname@gmail.com"}] @@ -454,10 +454,10 @@ var $result : Object $event.id:=$eventId $event.summary:="Updated Event Title" $event.description:="Updated Event description" -$event.start:={]New object +$event.start:={} $event.start.date:=Current date $event.start.time:=Current time -$event.end:={}New object +$event.end:={} $event.end.date:=Current date $event.end.time:=Current time+3600 From 6bb372e5728fd732aa4fe087209dd286e5eb17d9 Mon Sep 17 00:00:00 2001 From: mouna-elmaazouzi <118451160+mouna-elmaazouzi@users.noreply.github.com> Date: Wed, 11 Jun 2025 14:55:53 +0100 Subject: [PATCH 06/26] Update Office365.md --- docs/Office365.md | 45 ++++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/docs/Office365.md b/docs/Office365.md index 5e7ae7d..b3bb9e1 100644 --- a/docs/Office365.md +++ b/docs/Office365.md @@ -137,7 +137,7 @@ Refer to [this tutorial](#authenticate-to-the-microsoft-graph-api-in-service-mod #### Example ```4d -var $oAuth2 : cs.NetKit.OAuth2Provider +var $oAuth2 : cs.NetKit.OAuth2Provid var $Office365 : cs.NetKit.Office365 var $params; $calendarList; $calendarA : Object @@ -354,17 +354,19 @@ One of the following permissions is required to create an event: Create a calendar event: ```4d -var $Office365 : cs.NetKit.Microsoft +var $oAuth2 : cs.NetKit.OAuth2Provid +var $Office365 : cs.NetKit.Office365 var $event; $result : Object -$event:=New object +$event:={} $event.subject:="Team Sync" -$event.start:=New object -$event.start.dateTime:="2025-06-15T09:00:00" -$event.start.timeZone:="Europe/Paris" -$event.end:=New object -$event.end.dateTime:="2025-06-15T10:00:00" -$event.end.timeZone:="Europe/Paris" +$event.start:={} +$event.start.date:=Current date +$event.start.time:=Current time +$event.end:={} +$event.end.date:=Current date +$event.end.time:=Current time+3600 +$event.attendees:=[{email: "first.lastname@gmail.com"}] $result:=$Office365.calendar.createEvent($event) If (Not($result.success)) @@ -440,17 +442,19 @@ One of the following permissions is required to update an event: Update an already existing event calendar: ```4d -#DECLARE ($event : Object) - +#DECLARE($eventId:Text) +var $oAuth2 : cs.NetKit.OAuth2Provid var $Office365 : cs.NetKit.Office365 var $result : Object +$event.id:=$eventId $event.subject:="Updated Meeting Title" -$event.start:=New object -$event.start.dateTime:="2025-06-15T11:00:00" -$event.start.timeZone:="UTC" -$event.end:=New object -$event.end.dateTime:="2025-06-15T12:00:00" +$event.start:={} +$event.start.date:=Current date +$event.start.time:=Current time +$event.end:={} +$event.end.date:=Current date +$event.end.time:=Current time+3600 $event.end.timeZone:="UTC" $result:=$Office365.calendar.updateEvent($event) @@ -501,6 +505,9 @@ One of the following permissions is required to delete an event: Delete a calendar event: ```4d +var $oAuth2 : cs.NetKit.OAuth2Provid +var $Office365 : cs.NetKit.Office365 + $status:=$office365.calendar.deleteEvent({eventId: $event.event.id}) ``` @@ -548,8 +555,8 @@ One of the following permissions is required: #### Example ```4d - -var $o365 : cs.NetKit.Office365 +var $oAuth2 : cs.NetKit.OAuth2Provid +var $Office365 : cs.NetKit.Office365 var $result : Object ARRAY TEXT($toDisplay; 0) @@ -1604,4 +1611,4 @@ Until (Not($userList4.next())) ## See also [Google Class](./Google.md)
-[OAuth2Provider Class](./OAuth2Provider.md) \ No newline at end of file +[OAuth2Provider Class](./OAuth2Provider.md) From d42dd3dce5877ba46fe7acb6791643016b0efe47 Mon Sep 17 00:00:00 2001 From: mouna-elmaazouzi <118451160+mouna-elmaazouzi@users.noreply.github.com> Date: Wed, 11 Jun 2025 14:56:43 +0100 Subject: [PATCH 07/26] Update Google.md --- docs/Google.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/Google.md b/docs/Google.md index e188074..14841f5 100644 --- a/docs/Google.md +++ b/docs/Google.md @@ -382,7 +382,7 @@ var $event; $result : Object $event:={} $event.summary:="Team Meeting" -$event.start:={] +$event.start:={} $event.start.date:=Current date $event.start.time:=Current time $event.end:={} @@ -428,8 +428,6 @@ And in *option*, you can pass the following additional optional properties: | sendUpdates | String | Defines who should receive email notifications about the update. Acceptable values:
• `"all"` – Notify all attendees.
• `"externalOnly"` – Notify only non-Google users.
• `"none"` – No notifications sent. | | supportsAttachments | Boolean | Indicates whether the API client supports attachments. Must be `true` to modify the [`attachments`](#attachment-object-google) property. Defaults to `false`. | | fullUpdate | Boolean | If `true`, the full event is replaced. If `false` (default), only specified fields are updated. | - -> **Note:** This method replaces the entire event with the data you send. To avoid losing information, always include required fields like `start` and `end`. #### Returned Object From 60684ca115331d3f35230b80a579ea5c33e63197 Mon Sep 17 00:00:00 2001 From: mouna-elmaazouzi <118451160+mouna-elmaazouzi@users.noreply.github.com> Date: Wed, 11 Jun 2025 14:57:55 +0100 Subject: [PATCH 08/26] Update Google.md --- docs/Google.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/Google.md b/docs/Google.md index 14841f5..38a13bb 100644 --- a/docs/Google.md +++ b/docs/Google.md @@ -340,7 +340,7 @@ var $events:=$google.calendar.getEvents({calendarId: $myCalendar.id; top: 10}) | Parameter | Type | | Description| | -------- | ------ | --- |--------------------------- | |event | Object | ->|Object containing details of the calendar [event](#event-object) to create | -|option | Object | -> | Object containing additional creation options | +|options | Object | -> | Object containing additional creation options | |Result|Object|<-|[Status object](#status-object-google-class)| #### Description @@ -406,7 +406,7 @@ End if | Parameter | Type | | Description| | -------- | ----- | -------- | --------------- | |event |Object|->| Object containing details of the calendar [event](#event-object) to update. | -|option |Object|->| Object containing additional update options. | +|options |Object|->| Object containing additional update options. | |Result | Object | <-| [Status object](#status-object-google-class) | #### Description @@ -421,7 +421,7 @@ In *event*, you must include the following required properties: | start | Object | Start time of the event. | | end | Object | End time of the event. | -And in *option*, you can pass the following additional optional properties: +And in *options*, you can pass the following additional optional properties: | Property | Type | Description | |------------|---------|-------------| From 402ca73bf30fae10c9cd02390c259dab63f43502 Mon Sep 17 00:00:00 2001 From: mouna-elmaazouzi <118451160+mouna-elmaazouzi@users.noreply.github.com> Date: Wed, 11 Jun 2025 15:09:58 +0100 Subject: [PATCH 09/26] Update Google.md --- docs/Google.md | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/docs/Google.md b/docs/Google.md index 38a13bb..579cacc 100644 --- a/docs/Google.md +++ b/docs/Google.md @@ -507,48 +507,34 @@ $status:=$google.calendar.deleteEvent({eventId: $event.id}) The `event` object used with Google Calendar methods includes the following properties: -| Property | | Type | Description| +| Property | | Type | Description| | ------ |---| -------- | ------------------- | +|id | Text | ID for the event.| | calendarId | | Text | Calendar ID. If not provided, the user's primary calendar is used. Use `Google.calendar.getCalendars()` to retrieve IDs.| -| attachments | | Collection | File [attachments](#attachment-object-google) (max 25). To use this, `supportsAttachments` must be set to `true` in the request.| -| attendees| | Collection | List of attendees. | +| attachments | | Collection | File [attachments](#attachment-object-google) (max 25). To use this, `supportsAttachments` must be set to `true` in the request.| | attendees| | Collection | List of attendees. | | | email | String | **Required.** Email address of the attendee. | | | displayName | String | Name of the attendee. | | | comment| String | The attendee’s response comment. | | | optional| Boolean | (Default: false) Whether the attendee is optional.| | | resource| Boolean | (Default: false) Set to `true` when the attendee is a resource (e.g., room or equipment). Can only be set when the attendee is first added. Ignored in later updates. | | | additionalGuests| Integer | (Default: `0`) Allowed number of additional guests of the attendee. | -| description | | Text | Description of the event (HTML allowed).| -| start | | Object | Start time. Use `dateTime` with optional `timeZone`, or `date` for all-day events.| +| description | | Text | Description of the event (HTML allowed).| | start | | Object | Start time. Use `dateTime` with optional `timeZone`, or `date` for all-day events.| | | date | Date, Text | Start date of the event. If provided as text, use the format `"yyyy-mm-dd"`. | | | time | Time |Start time of the event (not present if all-day event)| | | dateTime | Text | Combined start date and time in RFC3339 format. A time zone offset is required unless `timeZone` is specified. IOverrides `date` and `time`.(not used for all-day events). | -| | timeZone | String | Time zone for the `dateTime`, using IANA format (e.g., `"Europe/Zurich"`). Defaults to UTC if not provided. | -| end | | Object | End time. Use `dateTime` with optional `timeZone`, or `date` for all-day events.| +| | timeZone | String | Time zone for the `dateTime`, using IANA format (e.g., `"Europe/Zurich"`). Defaults to UTC if not provided. | | end | | Object | End time. Use `dateTime` with optional `timeZone`, or `date` for all-day events.| | | date | Date, Text | End date of the event. If provided as text, use the format `"yyyy-mm-dd"`. | | | time | Time |End time of the event (not present if all-day event)| | | dateTime | Text |Combined date and time in RFC3339 format. A time zone offset is required unless `timeZone` is specified. Overrides `date` and `time`.(not used for all-day events). | | | timeZone | String | Time zone for the `dateTime`, using IANA format (e.g., `"Europe/Zurich"`). Defaults to UTC if not provided. | -| eventType | | Text | Specific type of the event (Cannot be changed after creation).
Possible values: `"default"`, `"birthday"`, `"focusTime"`, `"outOfOffice"`, etc.| -| extendedProperties.private | | Object | [Custom key-value pairs](https://developers.google.com/calendar/api/v3/reference/events#extendedProperties) only visible to the event owner to store additional information (e.g; `"internalNote": "Discuss Q3 targets"`)| -| extendedProperties.shared | | Object | [Custom key-value pairs](https://developers.google.com/calendar/api/v3/reference/events#extendedProperties) shared with all attendees to share additional notes or tags (e.g., `"projectCode": "XYZ123"`).| +| eventType | | Text | Specific type of the event (Cannot be changed after creation).
Possible values: `"default"`, `"birthday"`, `"focusTime"`, `"outOfOffice"`, etc.| | extendedProperties.private | | Object | [Custom key-value pairs](https://developers.google.com/calendar/api/v3/reference/events#extendedProperties) only visible to the event owner to store additional information (e.g; `"internalNote": "Discuss Q3 targets"`)| | extendedProperties.shared | | Object | [Custom key-value pairs](https://developers.google.com/calendar/api/v3/reference/events#extendedProperties) shared with all attendees to share additional notes or tags (e.g., `"projectCode": "XYZ123"`).| | focusTimeProperties| | Object | [Focus Time event-specific settings](https://developers.google.com/calendar/api/v3/reference/events#focustimeproperties). Used when `eventType` is `"focusTime"`.| -| guestsCanInviteOthers | | Boolean | (Default: true) If attendees can invite guests. | -| guestsCanModify | | Boolean | (Default: false) If attendees can edit the event. | -| guestsCanSeeOtherGuests| | Boolean | (Default: true) If attendees can see each other.| -| location | | Text | Event location.| +| guestsCanInviteOthers | | Boolean | (Default: true) If attendees can invite guests. | | guestsCanModify | | Boolean | (Default: false) If attendees can edit the event. | | guestsCanSeeOtherGuests| | Boolean | (Default: true) If attendees can see each other.| | location | | Text | Event location.| | recurrence\[] | | List | List of ***RRULE**( the main rule (e.g., FREQ=WEEKLY;BYDAY=MO))/**EXRULE**(exceptions to the rule)/**RDATE**(specific additional dates to include)/**EXDATE**(specific dates to exclude)* rules for repeating events using [RFC5545](https://www.rfc-editor.org/rfc/rfc5545) format. Does not include start/end times, use the `start` and `end` for that. Omit this field for one-time events. | -| reminders.useDefault | | Boolean | Whether to use the calendar’s default reminders.| -| reminders.overrides\[] | | List | Custom reminders.| +| reminders.useDefault | | Boolean | Whether to use the calendar’s default reminders.| | reminders.overrides\[] | | List | Custom reminders.| | | method | String | **Required**. Method of the reminder: "email" or "popup"| | | minutes | Integer | **Required**. Time before event (in minutes) when reminder should trigger. Between 0 and 40320.| -| reminders.useDefault | | Boolean | Whether the default reminders of the calendar apply to the event.| -| source.title | | Text | Title of the source linked to the event, such as a web page or email subject.| -| source.url | | Text | URL of the source linked to the event (must use `http` or `https`).| -| status | | Text |Describes the event's current state.
Possible values: `"confirmed"` (default) `"tentative"`, or `"cancelled"`.| -| summary | | Text | Title of the event.| -| transparency | | Text | Whether the event blocks time on the calendar. Values: `"opaque"` (busy) or `"transparent"` (available).| -| visibility | | Text | Visibility level: `"default"`, `"public"`, `"private"`, or `"confidential"`.| +| reminders.useDefault | | Boolean | Whether the default reminders of the calendar apply to the event.| | source.title | | Text | Title of the source linked to the event, such as a web page or email subject.| | source.url | | Text | URL of the source linked to the event (must use `http` or `https`).| | status | | Text |Describes the event's current state.
Possible values: `"confirmed"` (default) `"tentative"`, or `"cancelled"`.| | summary | | Text | Title of the event.| | transparency | | Text | Whether the event blocks time on the calendar. Values: `"opaque"` (busy) or `"transparent"` (available).| | visibility | | Text | Visibility level: `"default"`, `"public"`, `"private"`, or `"confidential"`.| ## Mail From 84059bf2aa83e93b6a8ea5a97211665f747e609e Mon Sep 17 00:00:00 2001 From: mouna-elmaazouzi <118451160+mouna-elmaazouzi@users.noreply.github.com> Date: Wed, 11 Jun 2025 15:26:23 +0100 Subject: [PATCH 10/26] Update Google.md --- docs/Google.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Google.md b/docs/Google.md index 579cacc..7a80220 100644 --- a/docs/Google.md +++ b/docs/Google.md @@ -17,7 +17,7 @@ The `Google` class is instantiated by calling the `cs.NetKit.Google.new()` funct * [cs.NetKit.Google.new()](#csnetkitgooglenew) -### [Calendar](#calendar) +### [Calendar](#calendar1) * [Google.Calendar.getCalendar()](#googlecalendargetcalendar) * [Google.Calendar.getCalendars()](#googlecalendargetcalendars) From 72ffc639614c1e327b34a244ae1753332b7a018e Mon Sep 17 00:00:00 2001 From: mouna-elmaazouzi <118451160+mouna-elmaazouzi@users.noreply.github.com> Date: Wed, 11 Jun 2025 15:27:50 +0100 Subject: [PATCH 11/26] Update Google.md --- docs/Google.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/Google.md b/docs/Google.md index 7a80220..a368f47 100644 --- a/docs/Google.md +++ b/docs/Google.md @@ -17,7 +17,7 @@ The `Google` class is instantiated by calling the `cs.NetKit.Google.new()` funct * [cs.NetKit.Google.new()](#csnetkitgooglenew) -### [Calendar](#calendar1) +### [Calendar](#calendar-1) * [Google.Calendar.getCalendar()](#googlecalendargetcalendar) * [Google.Calendar.getCalendars()](#googlecalendargetcalendars) @@ -28,7 +28,7 @@ The `Google` class is instantiated by calling the `cs.NetKit.Google.new()` funct * [Google.Calendar.deleteEvent()](#googlecalendardeleteevent) * [Event object](#event-object) -### [Mail](#mail) +### [Mail](#mail-1) * [Google.mail.send()](#googlemailsend) * [Google.mail.append()](#googlemailappend) @@ -45,7 +45,7 @@ The `Google` class is instantiated by calling the `cs.NetKit.Google.new()` funct * [Google.mail.untrash()](#googlemailuntrash) * [labelInfo object](#labelinfo-object) -### [User](#user) +### [User](#user-1) * [Google.user.get()](#googleuserget) * [Google.user.getCurrent()](#googleusergetcurrent) From 1be0befbb6f4cc9baafaf4dd5861554d1c62163e Mon Sep 17 00:00:00 2001 From: mouna-elmaazouzi <118451160+mouna-elmaazouzi@users.noreply.github.com> Date: Wed, 11 Jun 2025 15:28:59 +0100 Subject: [PATCH 12/26] Update Google.md --- docs/Google.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Google.md b/docs/Google.md index a368f47..90b92a8 100644 --- a/docs/Google.md +++ b/docs/Google.md @@ -333,7 +333,7 @@ var $events:=$google.calendar.getEvents({calendarId: $myCalendar.id; top: 10}) ### Google.calendar.createEvent() -**Google.calendar.createEvent**(*event*: Object{; *option*: Object}) : Object +**Google.calendar.createEvent**(*event*: Object{; *options*: Object}) : Object #### Parameters @@ -399,7 +399,7 @@ End if ### Google.calendar.updateEvent() -**Google.calendar.updateEvent**(*event*: Object{; *option*: Object}) : Object +**Google.calendar.updateEvent**(*event*: Object{; *options*: Object}) : Object #### Parameters From 60fc269ebadee3b122eee2437e495deca10e2acf Mon Sep 17 00:00:00 2001 From: mouna-elmaazouzi <118451160+mouna-elmaazouzi@users.noreply.github.com> Date: Wed, 11 Jun 2025 15:42:01 +0100 Subject: [PATCH 13/26] Update Google.md --- docs/Google.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Google.md b/docs/Google.md index 90b92a8..57e7f2e 100644 --- a/docs/Google.md +++ b/docs/Google.md @@ -51,9 +51,9 @@ The `Google` class is instantiated by calling the `cs.NetKit.Google.new()` funct * [Google.user.getCurrent()](#googleusergetcurrent) * [Google.user.list()](#googleuserlist) -### [Status](#status-object-google-class) +### [Status](#status-object) -* [Status object](#status-object-google-class) +* [Status object](#status-object) ## **cs.NetKit.Google.new()** From ce3b174b9c914858faffaa4246e041b5020413f0 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Wed, 11 Jun 2025 17:19:28 +0200 Subject: [PATCH 14/26] Update Google.md --- docs/Google.md | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/docs/Google.md b/docs/Google.md index 57e7f2e..c2451ae 100644 --- a/docs/Google.md +++ b/docs/Google.md @@ -511,30 +511,44 @@ The `event` object used with Google Calendar methods includes the following prop | ------ |---| -------- | ------------------- | |id | Text | ID for the event.| | calendarId | | Text | Calendar ID. If not provided, the user's primary calendar is used. Use `Google.calendar.getCalendars()` to retrieve IDs.| -| attachments | | Collection | File [attachments](#attachment-object-google) (max 25). To use this, `supportsAttachments` must be set to `true` in the request.| | attendees| | Collection | List of attendees. | +| attachments | | Collection | File [attachments](#attachment-object-google) (max 25). To use this, `supportsAttachments` must be set to `true` in the request.| +| attendees| | Collection | List of attendees. | | | email | String | **Required.** Email address of the attendee. | | | displayName | String | Name of the attendee. | | | comment| String | The attendee’s response comment. | | | optional| Boolean | (Default: false) Whether the attendee is optional.| | | resource| Boolean | (Default: false) Set to `true` when the attendee is a resource (e.g., room or equipment). Can only be set when the attendee is first added. Ignored in later updates. | | | additionalGuests| Integer | (Default: `0`) Allowed number of additional guests of the attendee. | -| description | | Text | Description of the event (HTML allowed).| | start | | Object | Start time. Use `dateTime` with optional `timeZone`, or `date` for all-day events.| +| description | | Text | Description of the event (HTML allowed).| +| start | | Object | Start time. Use `dateTime` with optional `timeZone`, or `date` for all-day events.| | | date | Date, Text | Start date of the event. If provided as text, use the format `"yyyy-mm-dd"`. | | | time | Time |Start time of the event (not present if all-day event)| | | dateTime | Text | Combined start date and time in RFC3339 format. A time zone offset is required unless `timeZone` is specified. IOverrides `date` and `time`.(not used for all-day events). | -| | timeZone | String | Time zone for the `dateTime`, using IANA format (e.g., `"Europe/Zurich"`). Defaults to UTC if not provided. | | end | | Object | End time. Use `dateTime` with optional `timeZone`, or `date` for all-day events.| +| | timeZone | String | Time zone for the `dateTime`, using IANA format (e.g., `"Europe/Zurich"`). Defaults to UTC if not provided. | +| end | | Object | End time. Use `dateTime` with optional `timeZone`, or `date` for all-day events.| | | date | Date, Text | End date of the event. If provided as text, use the format `"yyyy-mm-dd"`. | | | time | Time |End time of the event (not present if all-day event)| | | dateTime | Text |Combined date and time in RFC3339 format. A time zone offset is required unless `timeZone` is specified. Overrides `date` and `time`.(not used for all-day events). | | | timeZone | String | Time zone for the `dateTime`, using IANA format (e.g., `"Europe/Zurich"`). Defaults to UTC if not provided. | -| eventType | | Text | Specific type of the event (Cannot be changed after creation).
Possible values: `"default"`, `"birthday"`, `"focusTime"`, `"outOfOffice"`, etc.| | extendedProperties.private | | Object | [Custom key-value pairs](https://developers.google.com/calendar/api/v3/reference/events#extendedProperties) only visible to the event owner to store additional information (e.g; `"internalNote": "Discuss Q3 targets"`)| | extendedProperties.shared | | Object | [Custom key-value pairs](https://developers.google.com/calendar/api/v3/reference/events#extendedProperties) shared with all attendees to share additional notes or tags (e.g., `"projectCode": "XYZ123"`).| -| focusTimeProperties| | Object | [Focus Time event-specific settings](https://developers.google.com/calendar/api/v3/reference/events#focustimeproperties). Used when `eventType` is `"focusTime"`.| -| guestsCanInviteOthers | | Boolean | (Default: true) If attendees can invite guests. | | guestsCanModify | | Boolean | (Default: false) If attendees can edit the event. | | guestsCanSeeOtherGuests| | Boolean | (Default: true) If attendees can see each other.| | location | | Text | Event location.| +| eventType | | Text | Specific type of the event (Cannot be changed after creation).
Possible values: `"default"`, `"birthday"`, `"focusTime"`, `"outOfOffice"`, etc.| +| extendedProperties.private | | Object | [Custom key-value pairs](https://developers.google.com/calendar/api/v3/reference/events#extendedProperties) only visible to the event owner to store additional information (e.g; `"internalNote": "Discuss Q3 targets"`)| | extendedProperties.shared | | Object | [Custom key-value pairs](https://developers.google.com/calendar/api/v3/reference/events#extendedProperties) shared with all attendees to share additional notes or tags (e.g., `"projectCode": "XYZ123"`).| +| focusTimeProperties| | Object | [Focus Time event-specific settings](https://developers.google.com/calendar/api/v3/reference/events#focustimeproperties). Used when `eventType` is `"focusTime"`.| +| guestsCanInviteOthers | | Boolean | (Default: true) If attendees can invite guests. | +| guestsCanModify | | Boolean | (Default: false) If attendees can edit the event. | +| guestsCanSeeOtherGuests| | Boolean | (Default: true) If attendees can see each other.| +| location | | Text | Event location.| | recurrence\[] | | List | List of ***RRULE**( the main rule (e.g., FREQ=WEEKLY;BYDAY=MO))/**EXRULE**(exceptions to the rule)/**RDATE**(specific additional dates to include)/**EXDATE**(specific dates to exclude)* rules for repeating events using [RFC5545](https://www.rfc-editor.org/rfc/rfc5545) format. Does not include start/end times, use the `start` and `end` for that. Omit this field for one-time events. | -| reminders.useDefault | | Boolean | Whether to use the calendar’s default reminders.| | reminders.overrides\[] | | List | Custom reminders.| +| reminders.useDefault | | Boolean | Whether to use the calendar’s default reminders.| +| reminders.overrides\[] | | List | Custom reminders.| | | method | String | **Required**. Method of the reminder: "email" or "popup"| | | minutes | Integer | **Required**. Time before event (in minutes) when reminder should trigger. Between 0 and 40320.| -| reminders.useDefault | | Boolean | Whether the default reminders of the calendar apply to the event.| | source.title | | Text | Title of the source linked to the event, such as a web page or email subject.| | source.url | | Text | URL of the source linked to the event (must use `http` or `https`).| | status | | Text |Describes the event's current state.
Possible values: `"confirmed"` (default) `"tentative"`, or `"cancelled"`.| | summary | | Text | Title of the event.| | transparency | | Text | Whether the event blocks time on the calendar. Values: `"opaque"` (busy) or `"transparent"` (available).| | visibility | | Text | Visibility level: `"default"`, `"public"`, `"private"`, or `"confidential"`.| +| reminders.useDefault | | Boolean | Whether the default reminders of the calendar apply to the event.| +| source.title | | Text | Title of the source linked to the event, such as a web page or email subject.| +| source.url | | Text | URL of the source linked to the event (must use `http` or `https`).| +| status | | Text |Describes the event's current state.
Possible values: `"confirmed"` (default) `"tentative"`, or `"cancelled"`.| +| summary | | Text | Title of the event.| +| transparency | | Text | Whether the event blocks time on the calendar. Values: `"opaque"` (busy) or `"transparent"` (available).| +| visibility | | Text | Visibility level: `"default"`, `"public"`, `"private"`, or `"confidential"`.| ## Mail From 66752f7f203b63ed07aa09d274c11071524d31f0 Mon Sep 17 00:00:00 2001 From: arnaud-4d Date: Wed, 11 Jun 2025 17:20:36 +0200 Subject: [PATCH 15/26] Update Google.md --- docs/Google.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Google.md b/docs/Google.md index c2451ae..39ab83e 100644 --- a/docs/Google.md +++ b/docs/Google.md @@ -509,7 +509,7 @@ The `event` object used with Google Calendar methods includes the following prop | Property | | Type | Description| | ------ |---| -------- | ------------------- | -|id | Text | ID for the event.| +|id || Text | ID for the event.| | calendarId | | Text | Calendar ID. If not provided, the user's primary calendar is used. Use `Google.calendar.getCalendars()` to retrieve IDs.| | attachments | | Collection | File [attachments](#attachment-object-google) (max 25). To use this, `supportsAttachments` must be set to `true` in the request.| | attendees| | Collection | List of attendees. | From f2aa40aa61585f2c6f47f4d96caad817cd9fbbb0 Mon Sep 17 00:00:00 2001 From: mouna-elmaazouzi Date: Fri, 13 Jun 2025 10:57:48 +0100 Subject: [PATCH 16/26] fisrt update --- docs/Google.md | 83 ++++++++++++++++++++++------------------------- docs/Office365.md | 55 +++++++++++++++++-------------- 2 files changed, 69 insertions(+), 69 deletions(-) diff --git a/docs/Google.md b/docs/Google.md index 39ab83e..2f33dad 100644 --- a/docs/Google.md +++ b/docs/Google.md @@ -57,14 +57,14 @@ The `Google` class is instantiated by calling the `cs.NetKit.Google.new()` funct ## **cs.NetKit.Google.new()** -**cs.NetKit.Google.new**( *oAuth2* : cs.NetKit.OAuth2Provider { ; *options* : Object } ) : cs.NetKit.Google +**cs.NetKit.Google.new**( *oAuth2* : cs.NetKit.OAuth2Provider { ; *param* : Object } ) : cs.NetKit.Google ### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| |oAuth2|cs.NetKit.OAuth2Provider|->| Object of the OAuth2Provider class | -|options|Object|->| Additional options | +|param|Object|->| Additional options | |Result|cs.NetKit.Google|<-| Object of the Google class| ### Description @@ -73,7 +73,7 @@ The `Google` class is instantiated by calling the `cs.NetKit.Google.new()` funct In `oAuth2`, pass an [OAuth2Provider object](#oauth2provider). -In `options`, you can pass an object that specifies the following options: +In `param`, you can pass an object that specifies the following options: |Property|Type|Description| |---------|---|------| @@ -333,33 +333,28 @@ var $events:=$google.calendar.getEvents({calendarId: $myCalendar.id; top: 10}) ### Google.calendar.createEvent() -**Google.calendar.createEvent**(*event*: Object{; *options*: Object}) : Object +**Google.calendar.createEvent**(*event*: Object{; *param*: Object}) : Object #### Parameters | Parameter | Type | | Description| | -------- | ------ | --- |--------------------------- | |event | Object | ->|Object containing details of the calendar [event](#event-object) to create | -|options | Object | -> | Object containing additional creation options | +|param | Object | -> | Object containing additional creation options | |Result|Object|<-|[Status object](#status-object-google-class)| #### Description `Google.calendar.createEvent()` creates a new calendar event. -In *event*, you must include the following required properties: +In *event*, pass an [event](#event-object) object to create. Only `start` and `end` properties are required. -| Property | Type | Description | -|--------------|--------|-------------| -| start | Object | Start time of the event. | -| end | Object | End time of the event. | - -And in *options*, you can pass the following additional optional properties: +In *param*, you can pass the following additional optional properties: |Property|Type|Description| |---------|--- |------| |sendUpdates|String|Defines who should receive email notifications about the event. Acceptable values:
• `"all"` – Notify all attendees.
• `"externalOnly"` – Notify only non-Google users.
• `"none"` – No notifications sent.| -|supportsAttachments|Boolean| Indicates whether the API client supports attachments. Must be `true` to create or modify the `attachments` property. Defaults to `false` | +|supportsAttachments|Boolean| Indicates whether the API client supports attachments. Must be `true` to create or modify the [`attachments`](#attachment-object-google) property. Defaults to `false` | #### Returned Object @@ -367,7 +362,7 @@ The method returns a [**status object**](status-object-google-class) with an add |Property|Type|Description| |---------|--- |------| -|event|Object|Event object returned by the server| +|event|Object|[Event object](#event-object) returned by the server| |success|Boolean| [see Status object](#status-object-google-class)| |statusText|Text| [see Status object](#status-object-google-class)| |errors|Collection| [see Status object](#status-object-google-class)| @@ -399,29 +394,23 @@ End if ### Google.calendar.updateEvent() -**Google.calendar.updateEvent**(*event*: Object{; *options*: Object}) : Object +**Google.calendar.updateEvent**(*event*: Object{; *param*: Object}) : Object #### Parameters | Parameter | Type | | Description| | -------- | ----- | -------- | --------------- | |event |Object|->| Object containing details of the calendar [event](#event-object) to update. | -|options |Object|->| Object containing additional update options. | +|param |Object|->| Object containing additional update options. | |Result | Object | <-| [Status object](#status-object-google-class) | #### Description `Google.calendar.updateEvent()` updates an existing event. - -In *event*, you must include the following required properties: -| Property | Type | Description | -|----------|--------|-------------| -| id | Text | ID of the event to update. | -| start | Object | Start time of the event. | -| end | Object | End time of the event. | +In *event*, pass an [event](#event-object) object to create. `start`, `end` and `id` properties are required. -And in *options*, you can pass the following additional optional properties: +And in *param*, you can pass the following additional optional properties: | Property | Type | Description | |------------|---------|-------------| @@ -435,7 +424,7 @@ The method returns a [**status object**](status-object-google-class) with an add |Property|Type|Description| |---------|--- |------| -|event|Object|Updated event object returned by the server| +|event|Object|Updated [event object](#event-object) returned by the server| |success|Boolean| [see Status object](#status-object-google-class)| |statusText|Text| [see Status object](#status-object-google-class)| |errors|Collection| [see Status object](#status-object-google-class)| @@ -501,6 +490,11 @@ Delete a calendar event: var $Google:=cs.NetKit.Google.new($Oauth) $status:=$google.calendar.deleteEvent({eventId: $event.id}) +If ($result.success) + ALERT("Event correctly deleted") +Else + ALERT($result.statusText) +End if ``` ### Event object @@ -513,7 +507,7 @@ The `event` object used with Google Calendar methods includes the following prop | calendarId | | Text | Calendar ID. If not provided, the user's primary calendar is used. Use `Google.calendar.getCalendars()` to retrieve IDs.| | attachments | | Collection | File [attachments](#attachment-object-google) (max 25). To use this, `supportsAttachments` must be set to `true` in the request.| | attendees| | Collection | List of attendees. | -| | email | String | **Required.** Email address of the attendee. | +| | email | String | Required in `param` parameter. Email address of the attendee. | | | displayName | String | Name of the attendee. | | | comment| String | The attendee’s response comment. | | | optional| Boolean | (Default: false) Whether the attendee is optional.| @@ -531,15 +525,16 @@ The `event` object used with Google Calendar methods includes the following prop | | dateTime | Text |Combined date and time in RFC3339 format. A time zone offset is required unless `timeZone` is specified. Overrides `date` and `time`.(not used for all-day events). | | | timeZone | String | Time zone for the `dateTime`, using IANA format (e.g., `"Europe/Zurich"`). Defaults to UTC if not provided. | | eventType | | Text | Specific type of the event (Cannot be changed after creation).
Possible values: `"default"`, `"birthday"`, `"focusTime"`, `"outOfOffice"`, etc.| -| extendedProperties.private | | Object | [Custom key-value pairs](https://developers.google.com/calendar/api/v3/reference/events#extendedProperties) only visible to the event owner to store additional information (e.g; `"internalNote": "Discuss Q3 targets"`)| | extendedProperties.shared | | Object | [Custom key-value pairs](https://developers.google.com/calendar/api/v3/reference/events#extendedProperties) shared with all attendees to share additional notes or tags (e.g., `"projectCode": "XYZ123"`).| +| extendedProperties.private | | Object | [Custom key-value pairs](https://developers.google.com/calendar/api/v3/reference/events#extendedProperties) only visible to the event owner to store additional information (e.g; `"internalNote": "Discuss Q3 targets"`)| +| extendedProperties.shared | | Object | [Custom key-value pairs](https://developers.google.com/calendar/api/v3/reference/events#extendedProperties) shared with all attendees to share additional notes or tags (e.g., `"projectCode": "XYZ123"`).| | focusTimeProperties| | Object | [Focus Time event-specific settings](https://developers.google.com/calendar/api/v3/reference/events#focustimeproperties). Used when `eventType` is `"focusTime"`.| | guestsCanInviteOthers | | Boolean | (Default: true) If attendees can invite guests. | | guestsCanModify | | Boolean | (Default: false) If attendees can edit the event. | | guestsCanSeeOtherGuests| | Boolean | (Default: true) If attendees can see each other.| | location | | Text | Event location.| -| recurrence\[] | | List | List of ***RRULE**( the main rule (e.g., FREQ=WEEKLY;BYDAY=MO))/**EXRULE**(exceptions to the rule)/**RDATE**(specific additional dates to include)/**EXDATE**(specific dates to exclude)* rules for repeating events using [RFC5545](https://www.rfc-editor.org/rfc/rfc5545) format. Does not include start/end times, use the `start` and `end` for that. Omit this field for one-time events. | +| recurrence\[] | | Collection | List of rules for repeating events using [RFC5545](https://www.rfc-editor.org/rfc/rfc5545) format (RRULE/EXRULE/RDATE/EXDATE (e.g., FREQ=WEEKLY;BYDAY=MO)). Does not include start/end times, use the `start` and `end` for that. Omit this field for one-time events. | | reminders.useDefault | | Boolean | Whether to use the calendar’s default reminders.| -| reminders.overrides\[] | | List | Custom reminders.| +| reminders.overrides\[] | | Collection | Custom reminders.| | | method | String | **Required**. Method of the reminder: "email" or "popup"| | | minutes | Integer | **Required**. Time before event (in minutes) when reminder should trigger. Between 0 and 40320.| | reminders.useDefault | | Boolean | Whether the default reminders of the calendar apply to the event.| @@ -781,14 +776,14 @@ A `mailLabel` object contains the following properties (note that additional inf ### Google.mail.getMail() -**Google.mail.getMail**( *mailID* : Text { ; *options* : Object } ) : Object
**Google.mail.getMail**( *mailID* : Text { ; *options* : Object } ) : Blob
+**Google.mail.getMail**( *mailID* : Text { ; *param* : Object } ) : Object
**Google.mail.getMail**( *mailID* : Text { ; *param* : Object } ) : Blob
#### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| |mailID|Text|->|ID of the message to retrieve | -|options|Object|->|Options | +|param|Object|->|Options for the message to retrieve| |Result|Object | Blob|<-| Downloaded mail| @@ -796,7 +791,7 @@ A `mailLabel` object contains the following properties (note that additional inf `Google.mail.getMail()` gets the specified message from the user's mailbox. -In *options*, you can pass several properties: +In *param*, you can pass several properties: |Property|Type|Description| |---------|--- |------| @@ -819,20 +814,20 @@ The method returns a mail in one of the following formats, depending on the `mai ### Google.mail.getMailIds() -**Google.mail.getMailIds**( { *options* : Object } ) : Object +**Google.mail.getMailIds**( { *param* : Object } ) : Object #### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| -|options|Object|->|Options for messages to get | +|param|Object|->|Options for messages to get | |Result|Object|<-| Status object | #### Description `Google.mail.getMailIds()` returns an object containing a collection of message ids in the user's mailbox. -In *options*, you can pass several properties: +In *param*, you can pass several properties: |Property|Type|Description| |---------|--- |------| @@ -871,14 +866,14 @@ https://www.googleapis.com/auth/gmail.metadata ### Google.mail.getMails() -**Google.mail.getMails**( *mailIDs* : Collection { ; *options* : Object } ) : Collection +**Google.mail.getMails**( *mailIDs* : Collection { ; *param* : Object } ) : Collection #### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| |mailIDs|Collection|->|Collection of strings (mail IDs), or a collection of objects (each object contains an ID property)| -|options|Object|->|Options| +|param|Object|->|Options| |Result|Collection|<-|Collection of mails in format depending on *mailType*: JMAP (collection of objects) or MIME (collection of blobs)
If no mail is returned, the collection is empty| @@ -888,7 +883,7 @@ https://www.googleapis.com/auth/gmail.metadata > The maximum number of IDs supported is 100. In order to get more than 100 mails, it's necessary to call the function multiple times; otherwise, the `Google.mail.getMails()` function returns null and throws an error. -In *options*, you can pass several properties: +In *param*, you can pass several properties: |Property|Type|Description| |---------|--- |------| @@ -973,14 +968,14 @@ https://www.googleapis.com/auth/gmail.modify ### Google.mail.update() -**Google.mail.update**( *mailIDs* : Collection ; *options* : Object) : Object +**Google.mail.update**( *mailIDs* : Collection ; *param* : Object) : Object #### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| |mailIDs|Collection|->|Collection of strings (mail IDs), or collection of objects (each object contains an ID property)| -|options|Object|->|Options| +|param|Object|->|Options| |Result|Object|<-| [Status object](#status-object-google-class) | > There is a limit of 1000 IDs per request. @@ -991,7 +986,7 @@ https://www.googleapis.com/auth/gmail.modify For more information check out the [label management documentation](https://developers.google.com/gmail/api/guides/labels). -In *options*, you can pass the following two properties: +In *param*, you can pass the following two properties: |Property|Type|Description| |---------|--- |------| @@ -1268,13 +1263,13 @@ var $currentUser2:=$google.user.getCurrent("phoneNumbers") ### Google.user.list() -**Google.user.list**( { *options* : Object } ) : Object +**Google.user.list**( { *param* : Object } ) : Object #### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| -|options|Object|->|A set of options defining how to retrieve and filter user data| +|param|Object|->|A set of options defining how to retrieve and filter user data| |Result|Object|<-|An object containing a structured collection of [user](https://developers.google.com/people/api/rest/v1/people#Person) data organized into pages| #### Description @@ -1283,7 +1278,7 @@ var $currentUser2:=$google.user.getCurrent("phoneNumbers") > If the contact sharing or the External Directory sharing is not allowed in the Google admin, the returned `users` collection is empty. -In *options*, you can pass the following properties: +In *param*, you can pass the following properties: |Property|Type|Description| |---------|--- |------| diff --git a/docs/Office365.md b/docs/Office365.md index b3bb9e1..44bbbf0 100644 --- a/docs/Office365.md +++ b/docs/Office365.md @@ -21,7 +21,7 @@ The `Office365` class can be instantiated in two ways: * [New Office365 provider](#new-office365-provider) -### [Calendar](#calendar) +### [Calendar](#calendar-1) * [Office365.calendar.getCalendar()](#office365calendargetcalendar) * [Office365.calendar.getCalendars()](#office365calendargetcalendars) @@ -33,7 +33,7 @@ The `Office365` class can be instantiated in two ways: * [Office365.category.list()](#office365categorylist) * [Event object](#event-object) -### [Mail](#mail) +### [Mail](#mail-1) * [Office365.mail.send()](#office365mailsend) * [Office365.mail.append()](#office365mailappend) @@ -52,7 +52,7 @@ The `Office365` class can be instantiated in two ways: * [Well-known folder names](#well-known-folder-names) * ["Microsoft" mail object properties](#microsoft-mail-object-properties) -### [User](#user) +### [User](#user-1) * [Office365.user.get()](#office365userget) * [Office365.user.getCurrent()](#office365usergetcurrent) @@ -65,14 +65,14 @@ The `Office365` class can be instantiated in two ways: ## **New Office365 provider** -**New Office365 provider**( *paramObj* : Object { ; *options* : Object } ) : cs.NetKit.Office365 +**New Office365 provider**( *paramObj* : Object { ; *param* : Object } ) : cs.NetKit.Office365 ### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| |paramObj|cs.NetKit.OAuth2Provider|->| Object of the OAuth2Provider class | -|options|Object|->| Additional options | +|param|Object|->| Additional options | |Result|cs.NetKit.Office365|<-| Object of the Office365 class| ### Description @@ -81,7 +81,7 @@ The `Office365` class can be instantiated in two ways: In `paramObj`, pass an [OAuth2Provider object](#new-auth2-provider). -In `options`, you can pass an object that specifies the following options: +In `param`, you can pass an object that specifies the following options: |Property|Type|Description| |---------|---|------| @@ -334,7 +334,7 @@ The method returns a [**status object**](#status-object-microsoft-class) with an | Property | Type | Description| | -------- | ---------- | ----------------------------------- | -| event| Object | Event object returned by the server | +| event| Object | [Event object](#event-object) returned by the server | | success | Boolean| See [Status object](#status-object-microsoft-class) | | statusText | Text| See [Status object](#status-object-microsoft-class) | | errors | Collection | See [Status object](#status-object-microsoft-class) | @@ -388,9 +388,8 @@ End if `Office365.calendar.updateEvent()` updates an existing calendar event. -> **Notes**: -> When using `Office365.calendar.updateEvent()`, you only need to include the fields you want to update. -> Any property you leave out will keep its current value, unless it needs to be recalculated due to changes in related fields (e.g., updating recurrence may affect dates). +> **Note**: + When using `Office365.calendar.updateEvent()`, you only need to include the fields you want to update. Any property you leave out will keep its current value, unless it needs to be recalculated due to changes in related fields (e.g., updating recurrence may affect dates). You can update the following properties: @@ -422,7 +421,7 @@ The method returns a [**status object**](#status-object-office365-class) with an | Property | Type | Description | | ---------- | ---------- | --------------------------------------------------- | -| event | Object | Updated event object returned by the server | +| event | Object | Updated [event object](#event-object) returned by the server | | success | Boolean | [see Status object](#status-object-office365-class) | | statusText | Text | [see Status object](#status-object-office365-class) | | errors | Collection | [see Status object](#status-object-office365-class) | @@ -509,6 +508,12 @@ var $oAuth2 : cs.NetKit.OAuth2Provid var $Office365 : cs.NetKit.Office365 $status:=$office365.calendar.deleteEvent({eventId: $event.event.id}) +If ($result.success) + ALERT("Event correctly deleted") +Else + ALERT($result.statusText) +End if + ``` ### Office365.category.list() @@ -581,7 +586,7 @@ The `event` object used with Microsoft Calendar methods includes the following p | calendarId | | Text | Calendar ID. If not provided, the user's primary calendar is used. | | attachments| | Collection | Event file attachments.| | attendees | | Collection | List of attendees.| -| | emailAddress | Text | **Required.** Attendee’s email address.| +| | emailAddress | Text | Required in `param` parameter. Attendee’s email address.| | | type | Text | Attendee role: `"required"`, `"optional"`, or `"resource"`.| | body | | Object |Body of the message associated with the event.| | | content | Text | Content of the body| @@ -868,18 +873,18 @@ The method returns a **mailFolder** object containing the following properties ( ### Office365.mail.getFolderList() -**Office365.mail.getFolderList**( *options* : Object ) : Object +**Office365.mail.getFolderList**( *param* : Object ) : Object #### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| -|options|Object|->| Description of folders to get| +|param|Object|->| Description of folders to get| |Result|Object|<-| Status object that contains folder list and other information| `Office365.mail.getFolderList()` allows you to get a mail folder collection of the signed-in user. -In *options*, pass an object to define the folders to get. The available properties for that object are (all properties are optional): +In *param*, pass an object to define the folders to get. The available properties for that object are (all properties are optional): | Property | Type | Description | |---|---|---| @@ -950,23 +955,23 @@ $subfolders:=$office365.mail.getFolderList($result.folders[8].id) ### Office365.mail.getMail() -**Office365.mail.getMail**( *mailId* : Text { ; *options* : Object } ) : Object
**Office365.mail.getMail**( *mailId* : Text { ; *options* : Object } ) : Blob +**Office365.mail.getMail**( *mailId* : Text { ; *param* : Object } ) : Object
**Office365.mail.getMail**( *mailId* : Text { ; *param* : Object } ) : Blob #### Parameters |Parameter||Type||Description| |-----|----|--- |:---:|------| |mailId||Text|->| Id of the mail to get| -|options||Object|->|Format options for the returned mail object| +|param||Object|->|Format options for the returned mail object| ||mailType|Text|| Type of the mail object to return. Available values:
- "MIME"
- "JMAP"
- "Microsoft" (default)
By default if omitted, the same format as the [`mail.type` property](#new-office365-provider) is used| ||contentType|Text|| Format of the `body` and `uniqueBody` properties to be returned. Available values:
- "text"
- "html" (default)| |Result||Blob | Object|<-| Downloaded mail| `Office365.mail.getMail()` allows you to get a single mail from its *mailId*. -By default, the mail is returned with its original format, as defined in the [`mail.type` property of the provider](#new-office365-provider). However, you can convert it to any type using the `mailType` property of the *options* parameter. +By default, the mail is returned with its original format, as defined in the [`mail.type` property of the provider](#new-office365-provider). However, you can convert it to any type using the `mailType` property of the *param* parameter. -You can also select the preferred format of the `body` and `uniqueBody` properties of the returned mail using the `contentType` property of the *options* parameter. +You can also select the preferred format of the `body` and `uniqueBody` properties of the returned mail using the `contentType` property of the *param* parameter. The data type of the function result depends on the mail type: @@ -1002,20 +1007,20 @@ $mail:=$office.mail.getMail($mailId) ### Office365.mail.getMails() -**Office365.mail.getMails**( *options* : Object ) : Object +**Office365.mail.getMails**( *param* : Object ) : Object #### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| -|options|Object|->| Description of mails to get| +|param|Object|->| Description of mails to get| |Result|Object|<-| Status object that contains mail list and other information| `Office365.mail.getMails()` allows you to get messages in the signed-in user's mailbox (for detailed information, please refer to the [Microsoft's documentation website](https://learn.microsoft.com/en-us/graph/api/user-list-messages?view=graph-rest-1.0&tabs=http)). This method returns mail bodies in HTML format only. -In *options*, pass an object to define the mails to get. The available properties for that object are (all properties are optional): +In *param*, pass an object to define the mails to get. The available properties for that object are (all properties are optional): | Property | Type | Description | |---|---|---| @@ -1527,20 +1532,20 @@ principalName,displayName,givenName,mail") ### Office365.user.list() -**Office365.user.list**({*options*: Object}) : Object +**Office365.user.list**({*param*: Object}) : Object #### Parameters |Parameter|Type||Description| |---------|--- |:---:|------| -|options|Object|->| Additional options for the search| +|param|Object|->| Additional options for the search| |result|Object|<-| Object holding a collection of users and additional info on the request| #### Description `Office365.user.list()` returns a list of Office365 users. -In *options*, you can pass an object to specify additional search options. The following table groups the available search options: +In *param*, you can pass an object to specify additional search options. The following table groups the available search options: | Property | Type | Description | |---|---|---| From 89b8b5a41fc96f41d54072fb087166fbdb9cb84b Mon Sep 17 00:00:00 2001 From: mouna-elmaazouzi Date: Fri, 13 Jun 2025 11:06:47 +0100 Subject: [PATCH 17/26] Update Office365.md --- docs/Office365.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Office365.md b/docs/Office365.md index 44bbbf0..2e19cb0 100644 --- a/docs/Office365.md +++ b/docs/Office365.md @@ -584,7 +584,7 @@ The `event` object used with Microsoft Calendar methods includes the following p | -------- | -- | ----- | ----------------------- | | id | | Text | ID for the event. Case-sensitive and read-only. May change if the event is moved to another calendar or folder. Use [`Prefer: IdType="ImmutableId"`](https://learn.microsoft.com/en-us/graph/outlook-immutable-id) to preserve it. | | calendarId | | Text | Calendar ID. If not provided, the user's primary calendar is used. | -| attachments| | Collection | Event file attachments.| +| attachments| | Collection | Event file [attachments](#attachment-object).| | attendees | | Collection | List of attendees.| | | emailAddress | Text | Required in `param` parameter. Attendee’s email address.| | | type | Text | Attendee role: `"required"`, `"optional"`, or `"resource"`.| From 065b0d351d944e1781cf6d80e47a9f95d37ce7bc Mon Sep 17 00:00:00 2001 From: mouna-elmaazouzi Date: Fri, 13 Jun 2025 11:15:37 +0100 Subject: [PATCH 18/26] Update Google.md --- docs/Google.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/Google.md b/docs/Google.md index 2f33dad..c94b791 100644 --- a/docs/Google.md +++ b/docs/Google.md @@ -533,11 +533,10 @@ The `event` object used with Google Calendar methods includes the following prop | guestsCanSeeOtherGuests| | Boolean | (Default: true) If attendees can see each other.| | location | | Text | Event location.| | recurrence\[] | | Collection | List of rules for repeating events using [RFC5545](https://www.rfc-editor.org/rfc/rfc5545) format (RRULE/EXRULE/RDATE/EXDATE (e.g., FREQ=WEEKLY;BYDAY=MO)). Does not include start/end times, use the `start` and `end` for that. Omit this field for one-time events. | -| reminders.useDefault | | Boolean | Whether to use the calendar’s default reminders.| | reminders.overrides\[] | | Collection | Custom reminders.| | | method | String | **Required**. Method of the reminder: "email" or "popup"| | | minutes | Integer | **Required**. Time before event (in minutes) when reminder should trigger. Between 0 and 40320.| -| reminders.useDefault | | Boolean | Whether the default reminders of the calendar apply to the event.| +| reminders.useDefault | | Boolean | Whether to use the calendar’s default reminders for the event.| | source.title | | Text | Title of the source linked to the event, such as a web page or email subject.| | source.url | | Text | URL of the source linked to the event (must use `http` or `https`).| | status | | Text |Describes the event's current state.
Possible values: `"confirmed"` (default) `"tentative"`, or `"cancelled"`.| From 16a9889c9b0567e90424e3c25ed1a36f2f0a980e Mon Sep 17 00:00:00 2001 From: mouna-elmaazouzi Date: Fri, 13 Jun 2025 16:41:57 +0100 Subject: [PATCH 19/26] update 3 --- docs/Google.md | 2 +- docs/Office365.md | 34 ++++++++-------------------------- 2 files changed, 9 insertions(+), 27 deletions(-) diff --git a/docs/Google.md b/docs/Google.md index c94b791..fd24ab4 100644 --- a/docs/Google.md +++ b/docs/Google.md @@ -491,7 +491,7 @@ var $Google:=cs.NetKit.Google.new($Oauth) $status:=$google.calendar.deleteEvent({eventId: $event.id}) If ($result.success) - ALERT("Event correctly deleted") + ALERT("Calendar event correctly deleted") Else ALERT($result.statusText) End if diff --git a/docs/Office365.md b/docs/Office365.md index 2e19cb0..b683403 100644 --- a/docs/Office365.md +++ b/docs/Office365.md @@ -328,9 +328,11 @@ var $events:=$office365.calendar.getEvents({calendarId: $myCalendar.id; top: 10} `Office365.calendar.createEvent()` creates a new calendar event. +In *event*, pass the properties you want to set for the event. + #### Returned Object -The method returns a [**status object**](#status-object-microsoft-class) with an additional `event` property: +The function returns a [**status object**](#status-object-microsoft-class) with an additional `event` property: | Property | Type | Description| | -------- | ---------- | ----------------------------------- | @@ -388,33 +390,13 @@ End if `Office365.calendar.updateEvent()` updates an existing calendar event. +In *event*, pass the event id (mandatory) and the properties you want to update. + +To check the updatable properties, please refer to the [event object](#event-object) table below. + > **Note**: When using `Office365.calendar.updateEvent()`, you only need to include the fields you want to update. Any property you leave out will keep its current value, unless it needs to be recalculated due to changes in related fields (e.g., updating recurrence may affect dates). -You can update the following properties: - -| Property | Description| -| ---------------------------- | --------------------------- | -|attendees| List of people invited to the event | -|body | Event description or message content | -|categories| Tags or labels assigned to the event | -|end| End date and time of the event | -|hideAttendees| If `true`, attendees can't see each other | -|importance | Level of importance (`low`, `normal`, `high`) | -|isAllDay| Whether the event lasts the entire day | -|isOnlineMeeting| Enables online meeting support | -|isReminderOn| Turns reminders on or off | -|location| Main location of the event | -|locations| List of additional locations | -|onlineMeetingProvider| Provider used (e.g., Teams, Skype)| -|recurrence| Recurrence pattern (e.g., daily, weekly) | -|reminderMinutesBeforeStart| Time before start to trigger reminder| -|responseRequested| Whether responses are expected from attendees| -|sensitivity | Event sensitivity (`normal`, `private`, etc.) | -|showAs| Availability status (`busy`, `free`, etc.) | -|start | Start date and time of the event | -|subject| Event title | - #### Returned Object The method returns a [**status object**](#status-object-office365-class) with an additional `event` property: @@ -509,7 +491,7 @@ var $Office365 : cs.NetKit.Office365 $status:=$office365.calendar.deleteEvent({eventId: $event.event.id}) If ($result.success) - ALERT("Event correctly deleted") + ALERT("Calendar event correctly deleted") Else ALERT($result.statusText) End if From e811a4d2d994fe2979c6d0f4b1abe4e7425dbd49 Mon Sep 17 00:00:00 2001 From: mouna-elmaazouzi Date: Fri, 13 Jun 2025 16:54:19 +0100 Subject: [PATCH 20/26] update 4 --- docs/Google.md | 2 +- docs/Office365.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/Google.md b/docs/Google.md index fd24ab4..9e79f45 100644 --- a/docs/Google.md +++ b/docs/Google.md @@ -507,7 +507,7 @@ The `event` object used with Google Calendar methods includes the following prop | calendarId | | Text | Calendar ID. If not provided, the user's primary calendar is used. Use `Google.calendar.getCalendars()` to retrieve IDs.| | attachments | | Collection | File [attachments](#attachment-object-google) (max 25). To use this, `supportsAttachments` must be set to `true` in the request.| | attendees| | Collection | List of attendees. | -| | email | String | Required in `param` parameter. Email address of the attendee. | +| | email | String | Required. Email address of the attendee. | | | displayName | String | Name of the attendee. | | | comment| String | The attendee’s response comment. | | | optional| Boolean | (Default: false) Whether the attendee is optional.| diff --git a/docs/Office365.md b/docs/Office365.md index b683403..cebeb83 100644 --- a/docs/Office365.md +++ b/docs/Office365.md @@ -568,12 +568,12 @@ The `event` object used with Microsoft Calendar methods includes the following p | calendarId | | Text | Calendar ID. If not provided, the user's primary calendar is used. | | attachments| | Collection | Event file [attachments](#attachment-object).| | attendees | | Collection | List of attendees.| -| | emailAddress | Text | Required in `param` parameter. Attendee’s email address.| +| | emailAddress | Text | Required. Attendee’s email address.| | | type | Text | Attendee role: `"required"`, `"optional"`, or `"resource"`.| | body | | Object |Body of the message associated with the event.| | | content | Text | Content of the body| -| | contentType | Text | Type of the content.
Possible values:`"text"` or `"html"`.| -| categories | | Collection | List of categories associated with the event. Must match the `displayName` of categories returned by `Office365.category.list()`. | +| | contentType | Text | Type of the content.
Possible values: `"text"` or `"html"`.| +| categories | | Collection | List of categories associated with the event. Must match the `displayName` of categories returned by [`Office365.category.list()`](#office365categorylist). | | start | | Object | Start time of the event.| | | date | Date | Start time of the event. If provided as text, use the format `"yyyy-mm-dd"`.| | | time | Time| Start time (not used for all-day events).| From 3b6b4dc118beb9a79a5b2bfe0639a1ecbbcf400e Mon Sep 17 00:00:00 2001 From: mouna-elmaazouzi Date: Tue, 17 Jun 2025 15:17:28 +0100 Subject: [PATCH 21/26] Update Office365.md --- docs/Office365.md | 99 ++++++++++++++++++++++++----------------------- 1 file changed, 50 insertions(+), 49 deletions(-) diff --git a/docs/Office365.md b/docs/Office365.md index cebeb83..2145da8 100644 --- a/docs/Office365.md +++ b/docs/Office365.md @@ -542,65 +542,66 @@ One of the following permissions is required: #### Example ```4d -var $oAuth2 : cs.NetKit.OAuth2Provid +var $oAuth2 : cs.NetKit.OAuth2Provid var $Office365 : cs.NetKit.Office365 var $result : Object -ARRAY TEXT($toDisplay; 0) - +var $toDisplay : Collection + $result:=$o365.category.list() +$toDisplay:=[] + If (Not($result.success)) - ALERT($result.statusText) -Else - // Process the category list - For each ($category; $result.categories) - APPEND TO ARRAY($toDisplay; $category.displayName) - End for each + ALERT($result.statusText) +Else + // Process the category list + For each ($category; $result.categories) + $toDisplay.push($category.displayName) + End for each End if ``` - ### Event object The `event` object used with Microsoft Calendar methods includes the following properties: -| Property | | Type | Description| -| -------- | -- | ----- | ----------------------- | -| id | | Text | ID for the event. Case-sensitive and read-only. May change if the event is moved to another calendar or folder. Use [`Prefer: IdType="ImmutableId"`](https://learn.microsoft.com/en-us/graph/outlook-immutable-id) to preserve it. | -| calendarId | | Text | Calendar ID. If not provided, the user's primary calendar is used. | -| attachments| | Collection | Event file [attachments](#attachment-object).| -| attendees | | Collection | List of attendees.| -| | emailAddress | Text | Required. Attendee’s email address.| -| | type | Text | Attendee role: `"required"`, `"optional"`, or `"resource"`.| -| body | | Object |Body of the message associated with the event.| -| | content | Text | Content of the body| -| | contentType | Text | Type of the content.
Possible values: `"text"` or `"html"`.| -| categories | | Collection | List of categories associated with the event. Must match the `displayName` of categories returned by [`Office365.category.list()`](#office365categorylist). | -| start | | Object | Start time of the event.| -| | date | Date | Start time of the event. If provided as text, use the format `"yyyy-mm-dd"`.| -| | time | Time| Start time (not used for all-day events).| -| | dateTime | Text | Combined start date and time (`"yyyy-mm-ddThh:mm:ss"` format). Overrides `date` and `time`. | -| | timeZone | Text | Time zone for the `dateTime`, using IANA format (e.g., `"Europe/Zurich"`). Defaults to UTC if not provided.| -| end | | Object | End time of the event.| -| | date | Date | End date of the event. If provided as text, use the format `"yyyy-mm-dd"`.| -| | time | Time | End time (not used for all-day events).| -| | dateTime | Text | Combined end date and time (`"yyyy-mm-ddThh:mm:ss"` format). Overrides `date` and `time`.| -| | timeZone | Text | Time zone for the `dateTime`, using IANA format (e.g., `"Europe/Zurich"`). Defaults to UTC if not provided.| -| isAllDay | | Boolean | (Default: false) Set to `true` if it's an all-day event.| -| isDraft | | Boolean |(Default: false) Set to `true` if changes have been made to the meeting but not yet sent to attendees.| -| isCancelled | | Boolean | (Default: false) Whether the event is canceled.| -| isReminderOn| | Boolean | (Default: false) Whether a reminder is set for the event.| -| isOnlineMeeting | | Boolean | (Default: false) Set to `true` to create an online meeting. Once set, the event stays online and further changes to this setting are ignored.| -| onlineMeetingProvider | | Text | Provider used: `"teamsForBusiness"`, `"skypeForBusiness"`, `"skypeForConsumer"`, etc.| -| location | | Object | Event [location object](https://learn.microsoft.com/en-us/graph/api/resources/location?view=graph-rest-1.0).| -| reminderMinutesBeforeStart | | Integer | Time in minutes before start to trigger reminder.| -| responseRequested | | Boolean | Whether a response is requested from attendees. Default is `true`.| -| recurrence | | Object | Recurrence pattern (e.g., daily, weekly) .| -| seriesMasterId | | Text | ID of the recurring series master event, if this event is part of a recurring series. | -| importance | | Text | Event importance: `"low"`, `"normal"`, or `"high"`.| -| sensitivity | | Text | Event sensitivity: `"normal"`, `"personal"`, `"private"`, `"confidential"`.| -| showAs| | Text | Availability status: `busy`, `free`, etc.| -| subject | | Text | Event title or subject line.| -| allowNewTimeProposals | | Boolean | (Default: true) Whether attendees can propose a new time.| -| hideAttendees | | Boolean | (Default: false) If `true`, attendees will only see themselves.| +| Property | | Type | Description| Updatable | +| -------- | -- | ----- | ----------------------- |-----------| +| id | | Text | ID for the event. Case-sensitive and read-only. May change if the event is moved to another calendar or folder. Use [`Prefer: IdType="ImmutableId"`](https://learn.microsoft.com/en-us/graph/outlook-immutable-id) to preserve it. | | +| calendarId | | Text | Calendar ID. If not provided, the user's primary calendar is used. | | +| attachments| | Collection | Event file [attachments](#attachment-object).| | +| attendees | | Collection | List of attendees.|Yes| +| | emailAddress | Text | Required. Attendee’s email address.| | +| | type | Text | Attendee role: `"required"`, `"optional"`, or `"resource"`.| | +| body | | Object |Body of the message associated with the event.| Yes | +| | content | Text | Content of the body| | +| | contentType | Text | Type of the content.
Possible values: `"text"` or `"html"`.| | +| categories | | Collection | List of categories associated with the event. Must match the `displayName` of categories returned by [`Office365.category.list()`](#office365categorylist). |Yes| +| start | | Object | Start time of the event.|Yes| +| | date | Date | Start time of the event. If provided as text, use the format `"yyyy-mm-dd"`.| | +| | time | Time| Start time (not used for all-day events).| | +| | dateTime | Text | Combined start date and time (`"yyyy-mm-ddThh:mm:ss"` format). Overrides `date` and `time`. | | +| | timeZone | Text | Time zone for the `dateTime`, using IANA format (e.g., `"Europe/Zurich"`). Defaults to UTC if not provided.| | +| end | | Object | End time of the event.|Yes| +| | date | Date | End date of the event. If provided as text, use the format `"yyyy-mm-dd"`.| | +| | time | Time | End time (not used for all-day events).| | +| | dateTime | Text | Combined end date and time (`"yyyy-mm-ddThh:mm:ss"` format). Overrides `date` and `time`.| | +| | timeZone | Text | Time zone for the `dateTime`, using IANA format (e.g., `"Europe/Zurich"`). Defaults to UTC if not provided.| | +| isAllDay | | Boolean | (Default: false) Set to `true` if it's an all-day event.|Yes| +| isDraft | | Boolean |(Default: false) Set to `true` if changes have been made to the meeting but not yet sent to attendees.| | +| isCancelled | | Boolean | (Default: false) Whether the event is canceled.| | +| isReminderOn| | Boolean | (Default: false) Whether a reminder is set for the event.| Yes | +| isOnlineMeeting | | Boolean | (Default: false) Set to `true` to create an online meeting. Once set, the event stays online and further changes to this setting are ignored.|Yes| +| onlineMeetingProvider | | Text | Provider used: `"teamsForBusiness"`, `"skypeForBusiness"`, `"skypeForConsumer"`, etc.|Yes | +|location| | Object| Event [location object](https://learn.microsoft.com/en-us/graph/api/resources/location?view=graph-rest-1.0).|Yes | +| reminderMinutesBeforeStart | | Integer | Time in minutes before start to trigger reminder.|Yes | +| responseRequested | | Boolean | Whether a response is requested from attendees. Default is `true`.|Yes | +| recurrence | | Object | [Recurrence pattern](https://learn.microsoft.com/en-us/graph/api/resources/recurrencepattern?view=graph-rest-1.0) (e.g., daily, weekly) .| Yes | +| seriesMasterId | | Text | ID of the recurring series master event, if this event is part of a recurring series. | | +| importance | | Text | Event importance: `"low"`, `"normal"`, or `"high"`.|Yes | +| sensitivity | | Text | Event sensitivity: `"normal"`, `"personal"`, `"private"`, `"confidential"`.| Yes | +| showAs| | Text | Availability status: `busy`, `free`, etc.| Yes | +| subject | | Text | Event title or subject line.| Yes | +| allowNewTimeProposals | | Boolean | (Default: true) Whether attendees can propose a new time.| | +| hideAttendees | | Boolean | (Default: false) If `true`, attendees will only see themselves.|Yes| ## Mail From e472c999773de51c5773e472ad5324c0404d66d8 Mon Sep 17 00:00:00 2001 From: mouna-elmaazouzi Date: Tue, 17 Jun 2025 16:29:42 +0100 Subject: [PATCH 22/26] Update Google.md --- docs/Google.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Google.md b/docs/Google.md index 9e79f45..7ecef5d 100644 --- a/docs/Google.md +++ b/docs/Google.md @@ -354,7 +354,7 @@ In *param*, you can pass the following additional optional properties: |Property|Type|Description| |---------|--- |------| |sendUpdates|String|Defines who should receive email notifications about the event. Acceptable values:
• `"all"` – Notify all attendees.
• `"externalOnly"` – Notify only non-Google users.
• `"none"` – No notifications sent.| -|supportsAttachments|Boolean| Indicates whether the API client supports attachments. Must be `true` to create or modify the [`attachments`](#attachment-object-google) property. Defaults to `false` | +|supportsAttachments|Boolean| `true` to allow creation or modification of the [`attachments`](#attachment-object-google) property. Defaults to `false` | #### Returned Object @@ -415,7 +415,7 @@ And in *param*, you can pass the following additional optional properties: | Property | Type | Description | |------------|---------|-------------| | sendUpdates | String | Defines who should receive email notifications about the update. Acceptable values:
• `"all"` – Notify all attendees.
• `"externalOnly"` – Notify only non-Google users.
• `"none"` – No notifications sent. | -| supportsAttachments | Boolean | Indicates whether the API client supports attachments. Must be `true` to modify the [`attachments`](#attachment-object-google) property. Defaults to `false`. | +| supportsAttachments | Boolean | `true` to allow creation or modification of the [`attachments`](#attachment-object-google) property. Defaults to `false`. | | fullUpdate | Boolean | If `true`, the full event is replaced. If `false` (default), only specified fields are updated. | #### Returned Object From 409195ef74f259840cfa041ae237e7371169fb2b Mon Sep 17 00:00:00 2001 From: mouna-elmaazouzi Date: Tue, 17 Jun 2025 16:33:15 +0100 Subject: [PATCH 23/26] Update Office365.md --- docs/Office365.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Office365.md b/docs/Office365.md index 2145da8..f106b82 100644 --- a/docs/Office365.md +++ b/docs/Office365.md @@ -561,11 +561,11 @@ End if ``` ### Event object -The `event` object used with Microsoft Calendar methods includes the following properties: +The `event` object used with Microsoft Calendar methods includes the following properties. For the full list, refer to the [official Microsoft documentation](https://learn.microsoft.com/en-us/graph/api/resources/event?view=graph-rest-1.0) | Property | | Type | Description| Updatable | | -------- | -- | ----- | ----------------------- |-----------| -| id | | Text | ID for the event. Case-sensitive and read-only. May change if the event is moved to another calendar or folder. Use [`Prefer: IdType="ImmutableId"`](https://learn.microsoft.com/en-us/graph/outlook-immutable-id) to preserve it. | | +| id | | Text | ID for the event. Case-sensitive and read-only. | | | calendarId | | Text | Calendar ID. If not provided, the user's primary calendar is used. | | | attachments| | Collection | Event file [attachments](#attachment-object).| | | attendees | | Collection | List of attendees.|Yes| From a03493378422998ee70b4c4444600a6d75e8d80c Mon Sep 17 00:00:00 2001 From: mouna-elmaazouzi Date: Tue, 17 Jun 2025 16:35:49 +0100 Subject: [PATCH 24/26] link added --- docs/Google.md | 1 + docs/Office365.md | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/Google.md b/docs/Google.md index 7ecef5d..3b704e9 100644 --- a/docs/Google.md +++ b/docs/Google.md @@ -543,6 +543,7 @@ The `event` object used with Google Calendar methods includes the following prop | summary | | Text | Title of the event.| | transparency | | Text | Whether the event blocks time on the calendar. Values: `"opaque"` (busy) or `"transparent"` (available).| | visibility | | Text | Visibility level: `"default"`, `"public"`, `"private"`, or `"confidential"`.| +For the full list, refer to the [official Google Calendar API documentation](https://developers.google.com/calendar/api/v3/reference/events#resource). ## Mail diff --git a/docs/Office365.md b/docs/Office365.md index f106b82..c047b61 100644 --- a/docs/Office365.md +++ b/docs/Office365.md @@ -561,7 +561,7 @@ End if ``` ### Event object -The `event` object used with Microsoft Calendar methods includes the following properties. For the full list, refer to the [official Microsoft documentation](https://learn.microsoft.com/en-us/graph/api/resources/event?view=graph-rest-1.0) +The `event` object used with Microsoft Calendar methods includes the following properties: | Property | | Type | Description| Updatable | | -------- | -- | ----- | ----------------------- |-----------| @@ -603,6 +603,8 @@ The `event` object used with Microsoft Calendar methods includes the following p | allowNewTimeProposals | | Boolean | (Default: true) Whether attendees can propose a new time.| | | hideAttendees | | Boolean | (Default: false) If `true`, attendees will only see themselves.|Yes| +For the full list, refer to the [official Microsoft documentation](https://learn.microsoft.com/en-us/graph/api/resources/event?view=graph-rest-1.0). + ## Mail ### Office365.mail.append() From b3983f355c16a031064bb042210a0014af883e9b Mon Sep 17 00:00:00 2001 From: mouna-elmaazouzi Date: Wed, 18 Jun 2025 14:12:10 +0100 Subject: [PATCH 25/26] link moved --- docs/Google.md | 3 +-- docs/Office365.md | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/docs/Google.md b/docs/Google.md index 3b704e9..cc207a3 100644 --- a/docs/Google.md +++ b/docs/Google.md @@ -499,7 +499,7 @@ End if ### Event object -The `event` object used with Google Calendar methods includes the following properties: +The `event` object used with Google Calendar methods includes the following main properties. For the full list, refer to the [official Google Calendar API documentation](https://developers.google.com/calendar/api/v3/reference/events#resource). | Property | | Type | Description| | ------ |---| -------- | ------------------- | @@ -543,7 +543,6 @@ The `event` object used with Google Calendar methods includes the following prop | summary | | Text | Title of the event.| | transparency | | Text | Whether the event blocks time on the calendar. Values: `"opaque"` (busy) or `"transparent"` (available).| | visibility | | Text | Visibility level: `"default"`, `"public"`, `"private"`, or `"confidential"`.| -For the full list, refer to the [official Google Calendar API documentation](https://developers.google.com/calendar/api/v3/reference/events#resource). ## Mail diff --git a/docs/Office365.md b/docs/Office365.md index c047b61..adc0e29 100644 --- a/docs/Office365.md +++ b/docs/Office365.md @@ -561,7 +561,7 @@ End if ``` ### Event object -The `event` object used with Microsoft Calendar methods includes the following properties: +The `event` object used with Microsoft Calendar methods includes the following main properties. For the full list, refer to the [official Microsoft documentation](https://learn.microsoft.com/en-us/graph/api/resources/event?view=graph-rest-1.0). | Property | | Type | Description| Updatable | | -------- | -- | ----- | ----------------------- |-----------| @@ -603,8 +603,6 @@ The `event` object used with Microsoft Calendar methods includes the following p | allowNewTimeProposals | | Boolean | (Default: true) Whether attendees can propose a new time.| | | hideAttendees | | Boolean | (Default: false) If `true`, attendees will only see themselves.|Yes| -For the full list, refer to the [official Microsoft documentation](https://learn.microsoft.com/en-us/graph/api/resources/event?view=graph-rest-1.0). - ## Mail ### Office365.mail.append() From 02444d59c123392464fc81cd431f4bb549b73e41 Mon Sep 17 00:00:00 2001 From: mouna-elmaazouzi Date: Tue, 24 Jun 2025 16:36:06 +0100 Subject: [PATCH 26/26] afterclosure --- docs/Google.md | 16 ++++------------ docs/Office365.md | 17 ++++------------- 2 files changed, 8 insertions(+), 25 deletions(-) diff --git a/docs/Google.md b/docs/Google.md index cc207a3..1890b6b 100644 --- a/docs/Google.md +++ b/docs/Google.md @@ -377,12 +377,8 @@ var $event; $result : Object $event:={} $event.summary:="Team Meeting" -$event.start:={} -$event.start.date:=Current date -$event.start.time:=Current time -$event.end:={} -$event.end.date:=Current date -$event.end.time:=Current time+3600 +$event.start:={date: Current date; time: Current time} +$event.end:={date: Current date; time: Current time+3600} $event.attendees:=[{email: "first.lastname@gmail.com"}] $event.description:="description of the event" @@ -441,12 +437,8 @@ var $result : Object $event.id:=$eventId $event.summary:="Updated Event Title" $event.description:="Updated Event description" -$event.start:={} -$event.start.date:=Current date -$event.start.time:=Current time -$event.end:={} -$event.end.date:=Current date -$event.end.time:=Current time+3600 +$event.start:={date: Current date; time: Current time} +$event.end:={date: Current date; time: Current time+3600} $result:=$Google.calendar.updateEvent($event) If (Not($result.success)) diff --git a/docs/Office365.md b/docs/Office365.md index adc0e29..c087d0a 100644 --- a/docs/Office365.md +++ b/docs/Office365.md @@ -362,12 +362,8 @@ var $event; $result : Object $event:={} $event.subject:="Team Sync" -$event.start:={} -$event.start.date:=Current date -$event.start.time:=Current time -$event.end:={} -$event.end.date:=Current date -$event.end.time:=Current time+3600 +$event.start:={date: Current date; time: Current time} +$event.end:={date: Current date; time: Current time+3600} $event.attendees:=[{email: "first.lastname@gmail.com"}] $result:=$Office365.calendar.createEvent($event) @@ -430,13 +426,8 @@ var $result : Object $event.id:=$eventId $event.subject:="Updated Meeting Title" -$event.start:={} -$event.start.date:=Current date -$event.start.time:=Current time -$event.end:={} -$event.end.date:=Current date -$event.end.time:=Current time+3600 -$event.end.timeZone:="UTC" +$event.start:={date: Current date; time: Current time} +$event.end:={date: Current date; time: Current time+3600} $result:=$Office365.calendar.updateEvent($event) If (Not($result.success))