You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Google.Calendar.getCalendar**( { *id* : Text } ) : Object
91
+
92
+
### Parameters
93
+
94
+
|Parameter|Type||Description|
95
+
|---------|--- |:---:|------|
96
+
|id|Text|->|ID of the calender to retrieve. |
97
+
|calendar|Object|<-| Object containing the details of the specified calendar. For more details, see the [Google Calendar API resource](https://developers.google.com/calendar/api/v3/reference/calendarList#resource).|
98
+
99
+
> 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.
100
+
101
+
### Description
102
+
103
+
`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.
104
+
105
+
### Example
106
+
107
+
```4d
108
+
109
+
var $google : cs.NetKit.Google
110
+
var $oauth2 : cs.NetKit.OAuth2Provider
111
+
var $param; $Calendars; $myCalendar : Object
112
+
113
+
$param:={}
114
+
$param.name:="google"
115
+
$param.permission:="signedIn"
116
+
$param.clientId:="your-client-id" // Replace with your Google identity platform client ID
|param|Object|->|Set of options to filter or refine the calendar list request.|
145
+
|Result|Object|<-|Object containing the calendar list with the related data.|
146
+
147
+
### Description
148
+
149
+
`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.
150
+
151
+
In *param*, you can pass the following optional properties:
152
+
153
+
|Property|Type|Description|
154
+
|---------|--- |------|
155
+
| maxResults | Integer | Maximum number of calendar entries returned per page. Default is 100. Maximum is 250.|
156
+
| minAccessRole | String | Minimum access role for the user in the returned calendars. Default is no restriction. Acceptable values:|
157
+
|||- "freeBusyReader": User can read free/busy information. |
158
+
|||- "owner": User can read, modify events, and control access. |
159
+
|||- "reader": User can read non-private events. |
160
+
|||- "writer": User can read and modify events. |
161
+
| showDeleted | Boolean | Whether to include deleted calendar list entries in the result. Optional. The default is False.|
162
+
| showHidden | Boolean | Whether to show hidden entries. Optional. The default is False.|
163
+
164
+
### Returned object
165
+
166
+
The function returns a Collection of details about the user's calendar list in the following properties:
|`calendars`| Collection | Collection of calendar objects present in the user's calendar list. Each calendar object contains details such as `id`, `summary`, and `accessRole`. |
171
+
|`isLastPage`| Boolean |`True` if the last page of results has been reached. |
172
+
|`page`| Integer | Current page number of results. Starts at `1`. By default, each page holds 100 results. |
173
+
|`next()`| Function | Loads the next page of calendar entries and increments the `page` property by 1. Returns: |
174
+
||| - `True` if the next page is loaded successfully. |
175
+
||| - `False` if no additional pages are available (the collection is not updated). |
176
+
|`previous()`| Function | Loads the previous page of calendar entries and decrements the `page` property by 1. Returns: |
177
+
||| - `True` if the previous page is loaded successfully. |
178
+
||| - `False` if no previous pages are available (the collection is not updated). |
179
+
|`statusText`| Text | Status message returned by the Google server or the last error message from the 4D error stack. |
180
+
|`success`| Boolean |`True` if the operation is successful, `False` otherwise. |
|param|Object|->|Object containing the necessary details to retrieve a specific event|
223
+
|Result|Object|<-|Object containing the retrieved event|
224
+
225
+
### Description
226
+
227
+
`Google.Calendar.getEvent()` retrieves a specific event from a Google Calendar using its unique `eventId`.
228
+
229
+
In *param*, you can pass the following properties:
230
+
231
+
|Property|Type|Description|
232
+
|---------|--- |------|
233
+
| eventId | String | (Required) The unique identifier of the event to retrieve |
234
+
| calendarId | String | Calendar identifier. To retrieve calendar IDs, call calendarList.list(). If not provided, the user's primary (currently logged-in) calendar is used |
235
+
| maxAttendees | Integer | Max number of attendees to be returned for the event|
236
+
| timeZone | String | Time zone used in the response (formatted as an IANA Time Zone Database name, e.g., "Europe/Zurich"). Defaults to UTC |
237
+
238
+
### Returned object
239
+
240
+
The function returns a Google [`event`](https://developers.google.com/calendar/api/v3/reference/events) object.
|param|Object|->|Object containing filters and options for retrieving calendar events|
251
+
|Result|Object|<-|Object containing the retrieved events|
252
+
253
+
### Description
254
+
255
+
`Google.Calendar.getEvents()` retrieves events on the specified calendar. If *param* is not provided, it returns all events from the user's primary calendar.
256
+
257
+
In *param*, you can pass the following optional properties:
258
+
259
+
|Property|Type|Description|
260
+
|---------|--- |------|
261
+
| calendarId | String | Calendar identifier. To retrieve calendar IDs, call `Google.Calendar.getCalendars()`. If not provided, the user's primary calendar is used. |
262
+
| eventTypes | String | Specifies the types of events to return. Can be repeated multiple times to retrieve multiple event types. If not set, all event types are returned. Acceptable values: "birthday" (special all-day events with annual recurrence), "default" (regular events), "focusTime" (focus time events), "fromGmail" (events from Gmail), "outOfOffice" (out-of-office events), "workingLocation" (working location events). |
263
+
| iCalUID | String | Searches for an event by its iCalendar ID. **Note:**`icalUID` and `id` are not identical. In recurring events, all occurrences have unique `id`s but share the same `icalUID`. |
264
+
| maxAttendees | Integer | Limits the number of attendees to be returned per event|
265
+
| top | Integer | Mximum number of events per page. Default is `250`, maximum is `2500`. |
266
+
| orderBy | String | Specifies how events should be ordered in the response. Default is an **unspecified but stable order**. Acceptable values: "startTime" (ascending, only when `singleEvents=True`), "updated" (ascending order of last modification time). |
267
+
| privateExtendedProperty | Collection | Returns events that match these properties specified as propertyName=value |
268
+
| search | String | Searches for events using free text in multiple fields, including summary, description, location, attendee names/emails, organizer names/emails, and working location properties. Also matches predefined keywords for out-of-office, focus-time, and working-location events. |
269
+
| sharedExtendedProperty | Collection | Returns events that match these properties specified as propertyName=value. The returned events match **all** specified constraints |
270
+
| showDeleted | Boolean | Whether to include deleted events (`status="cancelled"`) in the result. Defaults to `False`. Behavior depends on the `singleEvents` setting |
271
+
| showHiddenInvitations | Boolean | Whether to include hidden invitations in the result. Defaults to `False`|
272
+
| singleEvents | Boolean | Whether to expand recurring events into instances and return only individual events and instances, **excluding** the underlying recurring event. Defaults to `False`|
273
+
| startDateTime | Text, Object | Filters events by start time. If set, `endDateTime` must also be provided. **Text:** ISO 8601 UTC timestamp. **Object:** Must contain `date` (date type) and `time` (time type), formatted according to system settings |
274
+
| endDateTime | Text, Object | Filters events by end time. If set, `startDateTime` must also be provided. **Text:** ISO 8601 UTC timestamp. **Object:** Must contain `date` (date type) and `time` (time type), formatted according to system settings |
275
+
| timeZone | String | Time zone for the response, formatted as an IANA Time Zone Database name (e.g., "Europe/Zurich"). Defaults to UTC |
276
+
| 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`|
277
+
278
+
### Returned object
279
+
280
+
The method returns a [**status object**](#status-object-google-class) in addition to the following properties:
281
+
282
+
| Property | Type | Description |
283
+
|---| ---|---|
284
+
| isLastPage | Boolean | True if the last page is reached. |
285
+
| page | Integer | Page number of the user information. Defaults to 1, with a page size of 100 (configurable via top). |
286
+
| next() | Function | Fetches the next page of users, increments page by 1. Returns True if successful, False otherwise. |
287
+
| previous() | Function | Fetches the previous page of users, decrements page by 1. Returns True if successful, False otherwise. |
288
+
| kind | String | Type of collection ("calendar#events"). |
289
+
| etag | String | ETag of the collection. |
290
+
| summary | String | Title of the calendar (read-only). |
291
+
| calendarId | String | Calendar identifier, same as the calendarId passed in the parameter if present. |
292
+
| description | String | Description of the calendar (read-only). |
293
+
| updated | Text | Last modification time of the calendar (ISO 8601 UTC). |
294
+
| timeZone | String | Time zone of the calendar (formatted as an IANA Time Zone Database name, e.g., "Europe/Zurich"). |
295
+
| accessRole | String | User’s access role for the calendar (read-only). Possible values: "none", "freeBusyReader", "reader", "writer", "owner". |
296
+
| defaultReminders | Collection | Default reminders for the authenticated user. Applies to events that do not explicitly override them. |
297
+
| defaultReminders[].method | String | Method used for the reminder ("email" or "popup"). |
298
+
| defaultReminders[].minutes | Integer | Minutes before the event when the reminder triggers. |
299
+
| events | Collection | List of events on the calendar. If some events have attachments, an "attachments" attribute is added, containing a collection of attachments. |
300
+
301
+
### Example
302
+
303
+
```4d
304
+
305
+
// Gets all the calendars
306
+
var $calendars:=$google.calendar.getCalendars()
307
+
// For the rest of the example, we'll use the first calendar in the list
308
+
var $myCalendar:=$calendars.calendars[0]
309
+
310
+
// Gets all the event of the selected calendars
311
+
var $events:=$google.calendar.getEvents({calendarId: $myCalendar.id; top: 10})
0 commit comments