پرش به مستندات
Java

client.calendar()

هر متد در این فضای نام: امضا، پارامترها، آنچه برمی‌گرداند و یک نمونه.

متدها

Calendar events found in mail or put on the calendar here, expanded into occurrences, with invitations, changes, cancellations and answers sent by email.

calendar().listEvents

List one page of event occurrences inside a time window

محدوده‌های دسترسیcalendar:readنتایج را صفحه‌به‌صفحه مرور می‌کند
امضای متد
Page listEvents(RequestOptions options)

Expands every event in the workspace into its occurrences between from and to and returns one page of them, sorted by start time and then by event id. A recurring series gives one row per instance in the window, with its excluded dates left out, and every row points back to its event through eventId. The window is required because a repeating series has no end to list up to. Follow nextCursor while hasMore is true, with the same from, to and timezone, to read every occurrence, or let listAllEvents and iterateEvents do that walk.

to must be after from and at most 366 days later. A missing from or to is a 422 invalid_parameter, while a value that does not parse, a reversed or overlong window, or an unknown zone is a 400 invalid_parameter naming the field. Both bounds take an Instant or an ISO 8601 string, and the SDK sends an Instant as an ISO 8601 instant in UTC.

timezone is an IANA zone and defaults to UTC on the server. It is used to expand any event stored without a zone of its own, which is what decides the day an all day event lands on.

پارامترها

options.fromInstant or Stringالزامی

Start of the window.

options.toInstant or Stringالزامی

End of the window, after from and at most 366 days later.

options.timezoneString

IANA zone such as Europe/London, at most 64 characters. Defaults to UTC.

options.limitint

Occurrences per page, a whole number from 1 to 100. The server defaults to 25.

options.cursorString

The nextCursor of the previous page, sent with the same window. It is opaque, so never build one yourself.

options.apiKeyString

Overrides the client's API key for this call only.

خروجی

A Page of occurrence maps with items, hasMore and nextCursor. Each item has eventId, uid, start, end, allDay, summary, location, status, transparency, isOrganizer, organizerEmail, recurring, myPartstat and attendeeCount.

نمونه

Page page = client.calendar().listEvents(RequestOptions.create()    .set("from", "2026-10-10T22:34:28.823Z")    .set("to", "2026-10-17T22:34:28.823Z")    .set("timezone", "Europe/London")    .limit(50)); for (Map<String, Object> occurrence : page) {    System.out.println(occurrence.get("start") + " " + occurrence.get("summary") + " " + occurrence.get("myPartstat"));} if (page.hasMore()) {    System.out.println("Next page: " + page.nextCursor());}

نکته‌ها

  • myPartstat is the response recorded for any address this workspace holds on its own domains, or for the addresses a narrowed key covers, and null when none of them is an attendee. A workspace with no address on its own domains matches no attendee, so every row reads null.

  • A narrowed key only sees occurrences whose organiser is one of the addresses it covers or where one of them is an attendee.

  • Cancelled events are not filtered out. Check status for CANCELLED.

  • Nothing in the window is dropped. A series repeats at most once a day, so one series gives at most one row per day of the window, and every one of them is reachable through the pages.

  • The cursor holds the start time and event id of the last row, so an event deleted or moved between pages never breaks the walk. A cursor this list did not hand out is a 400 invalid_cursor.

همچنین در دسترس در

API
GET /calendar/events
TypeScript
calendar.listEvents()
Python
calendar.list_events()
Ruby
calendar.list_events
PHP
calendar->listEvents
Go
Calendar.ListEvents
C#
Calendar.ListEventsAsync
CLI
openemail calendar list-events

calendar().listAllEvents

Collect every occurrence inside a time window into one list

محدوده‌های دسترسیcalendar:readنتایج را صفحه‌به‌صفحه مرور می‌کند
امضای متد
List<Map<String, Object>> listAllEvents(RequestOptions options)

Walks every page of listEvents for one window and returns all of its occurrences, sorted by start time and then by event id. It follows nextCursor until hasMore is false, sending the same from, to and timezone with each request.

A window of up to 366 days of a busy calendar can hold thousands of occurrences, so prefer iterateEvents when you can stop early.

پارامترها

options.fromInstant or Stringالزامی

Start of the window.

options.toInstant or Stringالزامی

End of the window, after from and at most 366 days later.

options.timezoneString

IANA zone such as Europe/London, at most 64 characters. Defaults to UTC.

options.limitint

Page size for each request, 1 to 100. The server defaults to 25.

options.cursorString

Starts the walk from this cursor instead of the start of the window.

options.apiKeyString

Overrides the client API key for every page of this walk.

خروجی

A list of occurrence maps holding every occurrence in the window, earliest first.

نمونه

List<Map<String, Object>> occurrences = client.calendar().listAllEvents(RequestOptions.create()    .set("from", "2026-10-01T00:00:00Z")    .set("to", "2026-11-01T00:00:00Z")    .limit(100)); for (Map<String, Object> event : occurrences) {    System.out.println(event.get("status"));}

نکته‌ها

  • If any page fails the call throws and the occurrences already fetched are discarded.

همچنین در دسترس در

API
GET /calendar/events
TypeScript
calendar.listAllEvents()
Python
calendar.list_all_events()
Ruby
calendar.list_all_events
PHP
calendar->listAllEvents
Go
Calendar.ListAllEvents
C#
Calendar.ListAllEventsAsync

calendar().iterateEvents

Stream the occurrences inside a time window one at a time

محدوده‌های دسترسیcalendar:readنتایج را صفحه‌به‌صفحه مرور می‌کند
امضای متد
PagedIterable iterateEvents(RequestOptions options)

Returns a PagedIterable over the occurrences in one window that yields them individually, earliest first, and fetches the next page only when the current one is drained. Nothing is requested until you consume it, and breaking out of the loop stops further requests, which makes it the way to find the next free slot or the next meeting without reading the whole window.

The walk ends when hasMore is false, when a page carries no nextCursor, or when the server repeats a cursor.

پارامترها

options.fromInstant or Stringالزامی

Start of the window.

options.toInstant or Stringالزامی

End of the window, after from and at most 366 days later.

options.timezoneString

IANA zone such as Europe/London, at most 64 characters. Defaults to UTC.

options.limitint

Page size per request, 1 to 100. The server defaults to 25.

options.cursorString

Starts the walk from this cursor instead of the start of the window.

options.apiKeyString

Overrides the client API key for every page of this walk.

خروجی

A PagedIterable that yields one occurrence map per step.

نمونه

for (Map<String, Object> occurrence : client.calendar().iterateEvents(RequestOptions.create()    .set("from", "2026-10-10T22:34:28.825Z")    .set("to", "2026-11-09T22:34:28.825Z"))) {    System.out.println(occurrence.get("myPartstat") + " " + occurrence.get("start") + " " + occurrence.get("summary"));}

نکته‌ها

  • A page request that fails throws out of the for loop, after every occurrence of the pages before it has been yielded.

همچنین در دسترس در

API
GET /calendar/events
TypeScript
calendar.iterateEvents()
Python
calendar.iterate_events()
Ruby
calendar.iterate_events
PHP
calendar->iterateEvents
Go
Calendar.IterateEvents
C#
Calendar.IterateEventsAsync

calendar().getEvent

Read an event with its attendees

محدوده‌های دسترسیcalendar:read
امضای متد
Map<String, Object> getEvent(String id, RequestOptions options)

Returns a stored event with its attendees and their responses. What the server understood from the iCalendar data is structured here: recurrence holds the RRULE text, exdates the excluded instances, organizer the organiser and alarms the reminders, each a map with minutesBefore and action. The raw iCalendar source is not included, and getEventIcs serves the event as a document.

id is the event id, the eventId on an occurrence, and not the iCalendar uid. A recurring series is one event however many occurrences it has, so start and end describe its first instance. messageId and threadId link the event to mail in the mailbox when there is any.

Attendees come back in the order they were added, each with partstat, role, rsvp, cutype and respondedAt. A narrowed key gets a 404 unless one of the addresses it covers organises the event or is on the attendee list, and a key that holds a whole domain covers every address on it.

پارامترها

idStringالزامی

Event id, the eventId of an occurrence, such as cal_ followed by 24 hex characters.

options.apiKeyString

Overrides the client's API key for this call only.

خروجی

A map with id, uid, sequence, summary, description, location, url, start, end, allDay, timezone, recurrence, exdates, status, transparency, visibility, organizer, isOrganizer, source, messageId, threadId, alarms, attendees, createdAt and updatedAt.

نمونه

Page page = client.calendar().listEvents(RequestOptions.create().set("from", "2026-09-14T00:00:00Z").set("to", "2026-09-21T00:00:00Z")); Map<String, Object> event = client.calendar().getEvent((String) page.items().get(0).get("eventId")); System.out.println(event.get("summary") + " " + event.get("recurrence") + " " + event.get("attendees"));

نکته‌ها

  • status, transparency and visibility carry iCalendar values, and default to CONFIRMED, OPAQUE and PUBLIC.

  • An attendee's partstat defaults to NEEDS-ACTION and role to REQ-PARTICIPANT until a response is recorded.

همچنین در دسترس در

API
GET /calendar/events/{id}
TypeScript
calendar.getEvent()
Python
calendar.get_event()
Ruby
calendar.get_event
PHP
calendar->getEvent
Go
Calendar.GetEvent
C#
Calendar.GetEventAsync
CLI
openemail calendar get-event

calendar().getEventIcs

Download an event as an iCalendar document

محدوده‌های دسترسیcalendar:read
امضای متد
String getEventIcs(String id, RequestOptions options)

Returns the event serialised as an .ics document, as a raw string rather than parsed JSON. The server sends it as text/calendar; charset=utf-8 with a download filename built from the event's uid, and the SDK requests that type and returns the body untouched.

The document declares METHOD:PUBLISH, and the content type carries no method parameter. That is deliberate: a REQUEST document makes a calendar client offer accept and decline and reply to the organiser, and this endpoint has no authority to invite anyone. Import it to show what the event currently is, not to send an invitation.

It holds one VEVENT with the attendees and their participation status, the recurrence rule, excluded dates and alarms. Lines end in CRLF and long lines are folded. DTSTAMP is the time of the request, so two downloads of an unchanged event differ on that line.

پارامترها

idStringالزامی

Event id, the eventId of an occurrence.

options.apiKeyString

Overrides the client's API key for this call only.

خروجی

A string, the iCalendar text from BEGIN:VCALENDAR to END:VCALENDAR.

نمونه

String ics = client.calendar().getEventIcs("cal_8d3f0a2b9c4e41f7a6b5c2d1"); System.out.println(ics);

نکته‌ها

  • Errors still come back as JSON and throw ApiException, so a failure never comes back as a string.

  • Timed events are written in the zone they were created in, as local times with a TZID and a VTIMEZONE that carries the rules of that zone, and all day events as DATE values.

  • A narrowed key gets a 404 on the same terms as getEvent.

همچنین در دسترس در

API
GET /calendar/events/{id}/ics
TypeScript
calendar.getEventIcs()
Python
calendar.get_event_ics()
Ruby
calendar.get_event_ics
PHP
calendar->getEventIcs
Go
Calendar.GetEventIcs
C#
Calendar.GetEventIcsAsync
CLI
openemail calendar get-event-ics

calendar().createEvent

Put an event on the calendar

محدوده‌های دسترسیcalendar:write
امضای متد
Map<String, Object> createEvent(Map<String, Object> body, RequestOptions options)

Creates an event, as New event on the Calendar page of the app does. start and end take an Instant or ISO 8601 with a zone, and the SDK sends an Instant as a UTC instant. timezone is the IANA zone the event belongs to, which decides what an all-day event means.

With attendees, an invitation goes to each of them by email from from, which has to be an address the key may send as, so the call also needs emails:send. Send "sendInvites", false to keep it to your own calendar.

پارامترها

body.summaryStringالزامی

The title, 1 to 255 characters.

body.startInstant or Stringالزامی

When it starts, an Instant or ISO 8601 with a zone. An Instant is sent as an instant in UTC.

body.endInstant or Stringالزامی

When it ends, after start and at most two years later.

body.descriptionString

Notes about the event, up to 8,000 characters.

body.locationString

Where it is: a room, an address or a link.

body.urlString

A link that belongs to the event.

body.allDayboolean

Whether it fills whole days. start and end then mark the days.

body.timezoneString

The IANA zone the event belongs to, UTC unless you say.

body.recurrenceString

An RRULE such as FREQ=WEEKLY;BYDAY=MO when it repeats.

body.attendeesList<Map<String, Object>>

Up to 200 people to invite, each a map with email and, if you like, name and optional.

body.remindersList<Map<String, Object>>

Up to five reminders, each a map with minutesBefore and, if you like, action (DISPLAY, EMAIL or AUDIO, as in uk.openemail.constants.CalendarReminderActions).

body.transparencyString

OPAQUE shows you busy and TRANSPARENT free, as in uk.openemail.constants.CalendarTransparencies.

body.visibilityString

PUBLIC, PRIVATE or CONFIDENTIAL, as in uk.openemail.constants.CalendarVisibilities.

body.sendInvitesboolean

False keeps the change to your own calendar, and sends nothing.

body.fromString

The address the invitations come from. It has to be one the key may send as.

options.apiKeyString

Overrides the client's API key for this call only.

خروجی

A map for the new event, shaped like the one calendar().getEvent returns, with its attendees and their responses.

نمونه

Map<String, Object> event = client.calendar().createEvent(Body.of(    "summary", "Planning",    "start", "2026-10-12T09:00:00Z",    "end", "2026-10-12T09:30:00Z",    "attendees", List.of(Body.of("email", "[email protected]")),    "from", "[email protected]")); System.out.println(event.get("id") + " " + event.get("attendees"));

نکته‌ها

  • The SDK does not retry it, because a second call makes a second event and invites everybody again.

  • A key that may not send as from is refused with 403 from_address_forbidden, and an event with attendees and no from with 422 invalid_parameter. Invitations without emails:send are a 403 insufficient_scope.

همچنین در دسترس در

API
POST /calendar/events
TypeScript
calendar.createEvent()
Python
calendar.create_event()
Ruby
calendar.create_event
PHP
calendar->createEvent
Go
Calendar.CreateEvent
C#
Calendar.CreateEventAsync
CLI
openemail calendar create-event

calendar().updateEvent

Change an event

محدوده‌های دسترسیcalendar:write
امضای متد
Map<String, Object> updateEvent(String id, Map<String, Object> patch, RequestOptions options)

Changes an event you organise. A field you leave out keeps its value, and attendees replaces the whole list. Everyone invited gets the updated invitation by email from from, so a change to an event with attendees needs emails:send too, unless sendInvites is false.

پارامترها

idStringالزامی

Event id, the eventId of an occurrence, such as cal_ followed by 24 hex characters.

patch.summaryString

The title, 1 to 255 characters.

patch.startInstant or String

When it starts, an Instant or ISO 8601 with a zone. An Instant is sent as an instant in UTC.

patch.endInstant or String

When it ends, after start and at most two years later.

patch.descriptionString

Notes about the event, up to 8,000 characters.

patch.locationString

Where it is: a room, an address or a link.

patch.urlString

A link that belongs to the event.

patch.allDayboolean

Whether it fills whole days. start and end then mark the days.

patch.timezoneString

The IANA zone the event belongs to, UTC unless you say.

patch.recurrenceString

An RRULE such as FREQ=WEEKLY;BYDAY=MO when it repeats.

patch.attendeesList<Map<String, Object>>

Up to 200 people to invite, each a map with email and, if you like, name and optional. It replaces the whole list.

patch.remindersList<Map<String, Object>>

Up to five reminders, each a map with minutesBefore and, if you like, action (DISPLAY, EMAIL or AUDIO, as in uk.openemail.constants.CalendarReminderActions).

patch.transparencyString

OPAQUE shows you busy and TRANSPARENT free, as in uk.openemail.constants.CalendarTransparencies.

patch.visibilityString

PUBLIC, PRIVATE or CONFIDENTIAL, as in uk.openemail.constants.CalendarVisibilities.

patch.sendInvitesboolean

False keeps the change to your own calendar, and sends nothing.

patch.fromString

The address the invitations come from. It has to be one the key may send as.

options.apiKeyString

Overrides the client's API key for this call only.

خروجی

A map for the event as it stands after the change, shaped like the one calendar().getEvent returns, with sequence one higher.

نمونه

Map<String, Object> event = client.calendar().updateEvent("cal_3f9a1c7e5b2d48a06c1e9f4b", Body.of("start", "2026-10-12T10:00:00Z", "end", "2026-10-12T10:30:00Z")); System.out.println(event.get("start") + " " + event.get("sequence"));

نکته‌ها

  • The SDK does not retry it, because a retry after a lost response sends the update to everybody again.

  • An event organised by somebody else is refused with 403 not_organizer: answer it with respondToEvent instead. An event the key does not reach is a 404.

همچنین در دسترس در

API
PATCH /calendar/events/{id}
TypeScript
calendar.updateEvent()
Python
calendar.update_event()
Ruby
calendar.update_event
PHP
calendar->updateEvent
Go
Calendar.UpdateEvent
C#
Calendar.UpdateEventAsync
CLI
openemail calendar update-event

calendar().deleteEvent

Remove an event from the calendar

محدوده‌های دسترسیcalendar:write
امضای متد
Map<String, Object> deleteEvent(String id, RequestOptions options)

Removes an event for good, as Remove does in the app. Nobody else is told, so call off a meeting with others in it with cancelEvent instead.

پارامترها

idStringالزامی

Event id, the eventId of an occurrence, such as cal_ followed by 24 hex characters.

options.apiKeyString

Overrides the client's API key for this call only.

خروجی

A map with object, id and deleted set to true.

نمونه

Map<String, Object> result = client.calendar().deleteEvent("cal_3f9a1c7e5b2d48a06c1e9f4b"); System.out.println(result.get("id"));

نکته‌ها

  • An event organised by somebody else is refused with 403 not_organizer, and an event that is gone or that the key does not reach is a 404.

همچنین در دسترس در

API
DELETE /calendar/events/{id}
TypeScript
calendar.deleteEvent()
Python
calendar.delete_event()
Ruby
calendar.delete_event
PHP
calendar->deleteEvent
Go
Calendar.DeleteEvent
C#
Calendar.DeleteEventAsync
CLI
openemail calendar delete-event

calendar().cancelEvent

Call off a meeting

محدوده‌های دسترسیcalendar:write
امضای متد
Map<String, Object> cancelEvent(String id, Map<String, Object> body, RequestOptions options)

Cancels a meeting you organise, as Cancel meeting does in the app. It stays on the calendar with status CANCELLED, and everyone invited is told it is off by email from from, so a meeting with attendees also needs emails:send.

پارامترها

idStringالزامی

Event id, the eventId of an occurrence, such as cal_ followed by 24 hex characters.

body.fromString

The address the cancellation comes from. It has to be one the key may send as.

options.apiKeyString

Overrides the client's API key for this call only.

خروجی

A map for the event, shaped like the one calendar().getEvent returns, with status set to CANCELLED.

نمونه

Map<String, Object> event = client.calendar().cancelEvent("cal_3f9a1c7e5b2d48a06c1e9f4b", Body.of("from", "[email protected]")); System.out.println(event.get("status"));

نکته‌ها

  • The SDK does not retry it, because a retry sends the cancellation again.

  • An event organised by somebody else is refused with 403 not_organizer.

همچنین در دسترس در

API
POST /calendar/events/{id}/cancel
TypeScript
calendar.cancelEvent()
Python
calendar.cancel_event()
Ruby
calendar.cancel_event
PHP
calendar->cancelEvent
Go
Calendar.CancelEvent
C#
Calendar.CancelEventAsync
CLI
openemail calendar cancel-event

calendar().respondToEvent

Answer an invitation

محدوده‌های دسترسیcalendar:writeemails:send
امضای متد
Map<String, Object> respondToEvent(String id, Map<String, Object> body, RequestOptions options)

Accepts, declines or tentatively accepts an invitation, as the buttons of an invitation do in the app. The answer goes to the organiser by email from the invited address the key may send as, or from respondingAs when the invitation went to more than one of yours, so it needs emails:send as well.

پارامترها

idStringالزامی

Event id, the eventId of an occurrence, such as cal_ followed by 24 hex characters.

body.responseStringالزامی

ACCEPTED, DECLINED or TENTATIVE, as in uk.openemail.constants.CalendarResponses.

body.respondingAsString

Which of your invited addresses answers, when there is more than one.

body.proposedStartInstant or String

A new start to propose with your answer, an Instant or ISO 8601 with a zone, sent together with proposedEnd. An Instant is sent as an instant in UTC.

body.proposedEndInstant or String

The end of the proposed time.

options.apiKeyString

Overrides the client's API key for this call only.

خروجی

A map for the event, shaped like the one calendar().getEvent returns, with your answer on your attendee row.

نمونه

Map<String, Object> event = client.calendar().respondToEvent("cal_3f9a1c7e5b2d48a06c1e9f4b", Body.of("response", "ACCEPTED")); System.out.println(event.get("attendees"));

نکته‌ها

  • An event that invited none of the addresses the key may send as is refused with 403 not_invited, and a cancelled meeting with 409 event_cancelled.

  • When the organiser cannot be reached, nothing changes and the call is a 409 reply_not_sent.

  • With proposedStart and proposedEnd the organiser gets a counter-proposal, as Propose a new time sends from Google Calendar and Outlook, and decides whether to move the meeting.

همچنین در دسترس در

API
POST /calendar/events/{id}/respond
TypeScript
calendar.respondToEvent()
Python
calendar.respond_to_event()
Ruby
calendar.respond_to_event
PHP
calendar->respondToEvent
Go
Calendar.RespondToEvent
C#
Calendar.RespondToEventAsync
CLI
openemail calendar respond-to-event

calendar().declineProposal

Decline a proposed time

محدوده‌های دسترسیcalendar:writeemails:send
امضای متد
Map<String, Object> declineProposal(String id, Map<String, Object> body, RequestOptions options)

Keeps the original time of a meeting you organise after a guest proposed another one, as Keep the original does on the event in the app. The guest is told by email from from, or from the organising address, so it needs emails:send as well. To take the proposed time instead, change the event with calendar().updateEvent.

پارامترها

idStringالزامی

Event id, the eventId of an occurrence, such as cal_ followed by 24 hex characters.

body.attendeeStringالزامی

The guest whose proposal you decline, by email address.

body.fromString

The address the answer is sent from, when it is not the organising address.

options.apiKeyString

Overrides the client's API key for this call only.

خروجی

A map for the event, shaped like the one calendar().getEvent returns, with the guest's proposedStart and proposedEnd cleared.

نمونه

Map<String, Object> event = client.calendar().declineProposal("cal_3f9a1c7e5b2d48a06c1e9f4b", Body.of("attendee", "[email protected]")); System.out.println(event.get("summary") + " keeps its time");

نکته‌ها

همچنین در دسترس در

API
POST /calendar/events/{id}/decline-proposal
TypeScript
calendar.declineProposal()
Python
calendar.decline_proposal()
Ruby
calendar.decline_proposal
PHP
calendar->declineProposal
Go
Calendar.DeclineProposal
C#
Calendar.DeclineProposalAsync
CLI
openemail calendar decline-proposal

calendar().listFeeds

List calendar links

محدوده‌های دسترسیcalendar:read
امضای متد
List<Map<String, Object>> listFeeds(RequestOptions options)

Returns the secret links that publish your calendar to other calendar apps, as the Share tab of the calendar settings in the app lists them. Anyone with a link can read what it shows, so treat url and webcalUrl like passwords.

پارامترها

options.apiKeyString

Overrides the client's API key for this call only.

خروجی

A list of maps, each with id, name, mode, url, webcalUrl and when calendar apps last read it.

نمونه

List<Map<String, Object>> feeds = client.calendar().listFeeds(); for (Map<String, Object> feed : feeds) {    System.out.println(feed.get("name") + " " + feed.get("mode") + " " + feed.get("url"));}

نکته‌ها

  • A key limited to particular addresses or domains is refused with 422 capability_unsupported, because a link covers the whole calendar.

همچنین در دسترس در

API
GET /calendar/feeds
TypeScript
calendar.listFeeds()
Python
calendar.list_feeds()
Ruby
calendar.list_feeds
PHP
calendar->listFeeds
Go
Calendar.ListFeeds
C#
Calendar.ListFeedsAsync
CLI
openemail calendar list-feeds

calendar().createFeed

Create a calendar link

محدوده‌های دسترسیcalendar:write
امضای متد
Map<String, Object> createFeed(Map<String, Object> body, RequestOptions options)

Makes a secret link that publishes your calendar as an iCalendar feed, for Google Calendar (From URL), Outlook (Subscribe from web) or Apple Calendar (New subscription). full shows every detail, busy only the times you are busy. The calendar app reads the link again on its own schedule, usually every few hours.

پارامترها

body.nameStringالزامی

The name calendar apps show for the calendar, up to 100 characters.

body.modeStringالزامی

full for every detail, busy for busy times only, as in uk.openemail.constants.CalendarFeedModes.

options.apiKeyString

Overrides the client's API key for this call only.

خروجی

A map for the link with the new url and webcalUrl.

نمونه

Map<String, Object> feed = client.calendar().createFeed(Body.of("name", "Work (busy)", "mode", "busy")); System.out.println(feed.get("url"));

نکته‌ها

همچنین در دسترس در

API
POST /calendar/feeds
TypeScript
calendar.createFeed()
Python
calendar.create_feed()
Ruby
calendar.create_feed
PHP
calendar->createFeed
Go
Calendar.CreateFeed
C#
Calendar.CreateFeedAsync
CLI
openemail calendar create-feed

calendar().resetFeed

Reset a calendar link

محدوده‌های دسترسیcalendar:write
امضای متد
Map<String, Object> resetFeed(String id, RequestOptions options)

Replaces the secret in a calendar link, so the old address stops working everywhere it was shared. Paste the new address into the calendar apps you still want to update.

پارامترها

idStringالزامی

Calendar link id, cfd_ followed by 24 hex characters.

options.apiKeyString

Overrides the client's API key for this call only.

خروجی

A map for the link with its new url and webcalUrl.

نمونه

Map<String, Object> feed = client.calendar().resetFeed("cfd_3f9a1c7e5b2d48a06c1e9f4b"); System.out.println(feed.get("url"));

نکته‌ها

همچنین در دسترس در

API
POST /calendar/feeds/{id}/reset
TypeScript
calendar.resetFeed()
Python
calendar.reset_feed()
Ruby
calendar.reset_feed
PHP
calendar->resetFeed
Go
Calendar.ResetFeed
C#
Calendar.ResetFeedAsync
CLI
openemail calendar reset-feed

calendar().deleteFeed

Delete a calendar link

محدوده‌های دسترسیcalendar:write
امضای متد
Map<String, Object> deleteFeed(String id, RequestOptions options)

Turns a calendar link off for good. Calendar apps that subscribed to it stop getting updates.

پارامترها

idStringالزامی

Calendar link id, cfd_ followed by 24 hex characters.

options.apiKeyString

Overrides the client's API key for this call only.

خروجی

A map with object, id and deleted set to true.

نمونه

Map<String, Object> result = client.calendar().deleteFeed("cfd_3f9a1c7e5b2d48a06c1e9f4b"); System.out.println(result.get("id"));

نکته‌ها

همچنین در دسترس در

API
DELETE /calendar/feeds/{id}
TypeScript
calendar.deleteFeed()
Python
calendar.delete_feed()
Ruby
calendar.delete_feed
PHP
calendar->deleteFeed
Go
Calendar.DeleteFeed
C#
Calendar.DeleteFeedAsync
CLI
openemail calendar delete-feed

calendar().listSubscriptions

List calendar subscriptions

محدوده‌های دسترسیcalendar:read
امضای متد
List<Map<String, Object>> listSubscriptions(RequestOptions options)

Returns the other calendars you subscribe to by link, such as a Google or Outlook calendar address, a team rota or public holidays, as Other calendars in the app lists them. Their events show on your calendar, read-only.

پارامترها

options.apiKeyString

Overrides the client's API key for this call only.

خروجی

A list of maps, each with name, url, color, status, lastError and how many events it holds.

نمونه

List<Map<String, Object>> subscriptions = client.calendar().listSubscriptions(); for (Map<String, Object> subscription : subscriptions) {    System.out.println(subscription.get("name") + " " + subscription.get("status") + " " + subscription.get("eventCount"));}

نکته‌ها

  • status is failing while reads fail and are retried, and stopped after ten failures in a row until you refresh it.

همچنین در دسترس در

API
GET /calendar/subscriptions
TypeScript
calendar.listSubscriptions()
Python
calendar.list_subscriptions()
Ruby
calendar.list_subscriptions
PHP
calendar->listSubscriptions
Go
Calendar.ListSubscriptions
C#
Calendar.ListSubscriptionsAsync
CLI
openemail calendar list-subscriptions

calendar().createSubscription

Subscribe to a calendar

محدوده‌های دسترسیcalendar:write
امضای متد
Map<String, Object> createSubscription(Map<String, Object> body, RequestOptions options)

Adds a calendar by its iCalendar link, an https, http or webcal address, such as the secret address of a Google calendar or a published Outlook calendar. It is read at once, then again about every half hour. name defaults to the name the calendar gives itself.

پارامترها

body.urlStringالزامی

The calendar link, https, http or webcal.

body.nameString

The name to show, up to 100 characters.

body.colorString

The colour of its events, as in uk.openemail.constants.CalendarColors.

options.apiKeyString

Overrides the client's API key for this call only.

خروجی

A map for the subscription with its first events read.

نمونه

Map<String, Object> holidays = client.calendar().createSubscription(Body.of("url", "webcal://example.com/holidays.ics", "color", "green")); System.out.println(holidays.get("name") + " " + holidays.get("eventCount"));

نکته‌ها

همچنین در دسترس در

API
POST /calendar/subscriptions
TypeScript
calendar.createSubscription()
Python
calendar.create_subscription()
Ruby
calendar.create_subscription
PHP
calendar->createSubscription
Go
Calendar.CreateSubscription
C#
Calendar.CreateSubscriptionAsync
CLI
openemail calendar create-subscription

calendar().updateSubscription

Change a calendar subscription

محدوده‌های دسترسیcalendar:write
امضای متد
Map<String, Object> updateSubscription(String id, Map<String, Object> patch, RequestOptions options)

Renames a subscription or gives it another colour.

پارامترها

idStringالزامی

Subscription id, csb_ followed by 24 hex characters.

patch.nameString

The new name, up to 100 characters.

patch.colorString

The new colour, as in uk.openemail.constants.CalendarColors.

options.apiKeyString

Overrides the client's API key for this call only.

خروجی

A map for the subscription as it stands now.

نمونه

Map<String, Object> result = client.calendar().updateSubscription("csb_3f9a1c7e5b2d48a06c1e9f4b", Body.of("name", "Team rota", "color", "purple")); System.out.println(result.get("id") + " " + result.get("name"));

نکته‌ها

همچنین در دسترس در

API
PATCH /calendar/subscriptions/{id}
TypeScript
calendar.updateSubscription()
Python
calendar.update_subscription()
Ruby
calendar.update_subscription
PHP
calendar->updateSubscription
Go
Calendar.UpdateSubscription
C#
Calendar.UpdateSubscriptionAsync
CLI
openemail calendar update-subscription

calendar().refreshSubscription

Refresh a calendar subscription

محدوده‌های دسترسیcalendar:write
امضای متد
Map<String, Object> refreshSubscription(String id, RequestOptions options)

Reads a subscribed calendar again now instead of waiting for the next half-hourly read, and restarts one that stopped after repeated failures.

پارامترها

idStringالزامی

Subscription id, csb_ followed by 24 hex characters.

options.apiKeyString

Overrides the client's API key for this call only.

خروجی

A map for the subscription after the read, with status and lastError.

نمونه

Map<String, Object> subscription = client.calendar().refreshSubscription("csb_3f9a1c7e5b2d48a06c1e9f4b"); System.out.println(subscription.get("lastError"));

نکته‌ها

همچنین در دسترس در

API
POST /calendar/subscriptions/{id}/refresh
TypeScript
calendar.refreshSubscription()
Python
calendar.refresh_subscription()
Ruby
calendar.refresh_subscription
PHP
calendar->refreshSubscription
Go
Calendar.RefreshSubscription
C#
Calendar.RefreshSubscriptionAsync
CLI
openemail calendar refresh-subscription

calendar().deleteSubscription

Unsubscribe from a calendar

محدوده‌های دسترسیcalendar:write
امضای متد
Map<String, Object> deleteSubscription(String id, RequestOptions options)

Removes a subscription and every event it brought onto your calendar.

پارامترها

idStringالزامی

Subscription id, csb_ followed by 24 hex characters.

options.apiKeyString

Overrides the client's API key for this call only.

خروجی

A map with object, id and deleted set to true.

نمونه

Map<String, Object> result = client.calendar().deleteSubscription("csb_3f9a1c7e5b2d48a06c1e9f4b"); System.out.println(result.get("id"));

نکته‌ها

همچنین در دسترس در

API
DELETE /calendar/subscriptions/{id}
TypeScript
calendar.deleteSubscription()
Python
calendar.delete_subscription()
Ruby
calendar.delete_subscription
PHP
calendar->deleteSubscription
Go
Calendar.DeleteSubscription
C#
Calendar.DeleteSubscriptionAsync
CLI
openemail calendar delete-subscription

calendar().importIcs

Import a calendar file

محدوده‌های دسترسیcalendar:write
امضای متد
Map<String, Object> importIcs(byte[] data, RequestOptions options)

Sends an iCalendar (.ics) file as the request body and queues it. Its events become events of your own that you can edit, and nobody on them is sent anything, now or when you change them later, unless you ask for that on the change. Poll getImport until status is completed.

The file may be 10 MB and hold 25,000 events. Several calendars in one file are merged, and the report keeps their names. An event whose UID is already in the workspace is skipped and counted, never overwritten, so sending the same file twice adds nothing.

data is a byte array, and it goes out as text/calendar.

پارامترها

databyte[]الزامی

The .ics file: a byte array.

options.filenameString

The name to show for the file in the list of imports, at most 255 characters.

options.apiKeyString

Overrides the client API key for this call only.

خروجی

A map with status set to queued.

نمونه

Map<String, Object> queued = client.calendar().importIcs(Files.readAllBytes(Path.of("work.ics")), RequestOptions.of("filename", "work.ics")); System.out.println(queued.get("id") + " " + queued.get("status"));

نکته‌ها

  • A body that is not an iCalendar file is a 400 not_a_calendar_file, an empty one a 400 item_import_empty, and one holding more than 25,000 events a 400 too_many_events.

  • A file over 10 MB is a 413 item_import_too_large.

  • To send text you already hold, such as what getEventIcs returns, encode it first with text.getBytes(StandardCharsets.UTF_8).

  • An upload that outlasts the client timeout fails as a network error, so raise it on the client for a large file on a slow connection.

  • Not retried automatically.

همچنین در دسترس در

API
POST /calendar/imports
TypeScript
calendar.importIcs()
Python
calendar.import_ics()
Ruby
calendar.import_ics
PHP
calendar->importIcs
Go
Calendar.ImportIcs
C#
Calendar.ImportIcsAsync
CLI
openemail calendar import-ics

calendar().listImports

List calendar imports

محدوده‌های دسترسیcalendar:readنتایج را صفحه‌به‌صفحه مرور می‌کند
امضای متد
Page listImports(RequestOptions options)

Returns one page of the calendar files and calendars brought in, newest first, each with what it added and what it left out. Beside the files sent with importIcs it lists the calendars that came with a mailbox import, and those carry the id of that import in parentImportId.

Paging is keyset. limit takes 1 to 100 and defaults to 25, and nextCursor goes back as cursor while hasMore is true. listAllImports and iterateImports do that walk for you.

پارامترها

options.limitint

Imports per page, a whole number from 1 to 100. The server defaults to 25.

options.cursorString

The nextCursor from the previous page. Never build one yourself.

options.apiKeyString

Overrides the client API key for this call only.

خروجی

A Page of maps with items, hasMore and nextCursor.

نمونه

Page page = client.calendar().listImports(RequestOptions.create().limit(50)); for (Map<String, Object> item : page) {    System.out.println(item.get("fileName") + " " + item.get("status") + " " + item.get("counts"));} if (page.hasMore()) {    System.out.println("Next page: " + page.nextCursor());}

نکته‌ها

  • source is file for an upload. takeout, caldav and microsoft came with a mailbox import.

  • A cursor that names no import is a 400 invalid_cursor.

  • A GET is retried automatically on network failure and on 408, 500, 502, 503 and 504 responses, up to the client maxRetries, and on a 429 only when it carries a Retry-After of a minute or less.

همچنین در دسترس در

API
GET /calendar/imports
TypeScript
calendar.listImports()
Python
calendar.list_imports()
Ruby
calendar.list_imports
PHP
calendar->listImports
Go
Calendar.ListImports
C#
Calendar.ListImportsAsync
CLI
openemail calendar list-imports

calendar().listAllImports

Collect every calendar import into one list

محدوده‌های دسترسیcalendar:readنتایج را صفحه‌به‌صفحه مرور می‌کند
امضای متد
List<Map<String, Object>> listAllImports(RequestOptions options)

Follows nextCursor from page to page and returns every calendar import, newest first.

Everything is held in memory before the call settles. Prefer iterateImports when you can stop early. limit sets the page size of each request, not the total.

پارامترها

options.limitint

Page size per request, from 1 to 100, defaulting to 25 on the server.

options.cursorString

A cursor from an earlier page to start after.

options.apiKeyString

Overrides the client API key for every page of this walk.

خروجی

A list of maps holding every import across all pages.

نمونه

List<Map<String, Object>> imports = client.calendar().listAllImports(); for (Map<String, Object> item : imports) {    System.out.println(item.get("counts"));}

نکته‌ها

  • A failure on any page rejects the whole call, and the imports already fetched are discarded.

همچنین در دسترس در

API
GET /calendar/imports
TypeScript
calendar.listAllImports()
Python
calendar.list_all_imports()
Ruby
calendar.list_all_imports
PHP
calendar->listAllImports
Go
Calendar.ListAllImports
C#
Calendar.ListAllImportsAsync

calendar().iterateImports

Stream calendar imports one at a time

محدوده‌های دسترسیcalendar:readنتایج را صفحه‌به‌صفحه مرور می‌کند
امضای متد
PagedIterable iterateImports(RequestOptions options)

Returns a PagedIterable that yields calendar imports one by one, newest first, and requests the next page only once the current one is drained. Nothing is fetched until you consume it, and breaking out of the loop stops the requests.

پارامترها

options.limitint

Page size per request, from 1 to 100, defaulting to 25 on the server.

options.cursorString

A cursor from an earlier page to start after.

options.apiKeyString

Overrides the client API key for every page of this walk.

خروجی

A PagedIterable of maps yielding one import per step.

نمونه

for (Map<String, Object> item : client.calendar().iterateImports()) {    System.out.println(item.get("status") + " " + item.get("id") + " " + item.get("counts"));}

نکته‌ها

  • The generator is lazy, so an abandoned loop costs only the pages you consumed.

همچنین در دسترس در

API
GET /calendar/imports
TypeScript
calendar.iterateImports()
Python
calendar.iterate_imports()
Ruby
calendar.iterate_imports
PHP
calendar->iterateImports
Go
Calendar.IterateImports
C#
Calendar.IterateImportsAsync

calendar().getImport

Get a calendar import

محدوده‌های دسترسیcalendar:read
امضای متد
Map<String, Object> getImport(String id, RequestOptions options)

Returns one calendar import with its counts and its report: the calendars it read, how many events it left out and why, and up to 20 of the events it left out. Poll it after importIcs until status is completed or failed.

counts.imported is what was added and counts.skipped what was left out, which report.skipped breaks down by reason: uid-taken for an event that was already here, no-start for one with no start time, invalid for one that could not be read and empty for a file or calendar that held no events.

پارامترها

idStringالزامی

Calendar import id, iimp_ followed by 24 hex characters.

options.apiKeyString

Overrides the client API key for this call only.

خروجی

A map with status, counts, report, undoable and when it started, finished and was undone.

نمونه

Map<String, Object> item = client.calendar().getImport("iimp_3f9c2a7b1e4d8f60a5c7b92d"); System.out.println(item.get("status") + " " + item.get("counts") + " " + item.get("report"));

نکته‌ها

  • An id that names no calendar import is a 404 item_import_not_found.

  • A GET is retried automatically on network failure and on 408, 500, 502, 503 and 504 responses, up to the client maxRetries, and on a 429 only when it carries a Retry-After of a minute or less.

همچنین در دسترس در

API
GET /calendar/imports/{id}
TypeScript
calendar.getImport()
Python
calendar.get_import()
Ruby
calendar.get_import
PHP
calendar->getImport
Go
Calendar.GetImport
C#
Calendar.GetImportAsync
CLI
openemail calendar get-import

calendar().undoImport

Remove what a calendar import added

محدوده‌های دسترسیcalendar:write
امضای متد
Map<String, Object> undoImport(String id, RequestOptions options)

Deletes every event the import added, changed since or not, and marks the import undone. Nobody is told. Events that were skipped because they were already here are not touched.

پارامترها

idStringالزامی

Calendar import id, iimp_ followed by 24 hex characters.

options.apiKeyString

Overrides the client API key for this call only.

خروجی

A map with status set to undone and undoneAt set.

نمونه

Map<String, Object> undone = client.calendar().undoImport("iimp_3f9c2a7b1e4d8f60a5c7b92d"); System.out.println(undone.get("status") + " " + undone.get("undoneAt") + " " + undone.get("counts"));

نکته‌ها

  • An import that is still running, or was already removed, is a 409 item_import_not_undoable. undoable on the import says whether the call would remove anything.

  • An id that names no calendar import is a 404 item_import_not_found.

  • Not retried automatically.

همچنین در دسترس در

API
POST /calendar/imports/{id}/undo
TypeScript
calendar.undoImport()
Python
calendar.undo_import()
Ruby
calendar.undo_import
PHP
calendar->undoImport
Go
Calendar.UndoImport
C#
Calendar.UndoImportAsync
CLI
openemail calendar undo-import