client.calendar()
Cada método de este espacio de nombres: su firma, sus parámetros, lo que devuelve y un ejemplo.
Métodos
Calendar events found in mail or put on the calendar here, expanded into occurrences, with invitations, changes, cancellations and answers sent by email.
calendar().listEventscalendar().listAllEventscalendar().iterateEventscalendar().getEventcalendar().getEventIcscalendar().createEventcalendar().updateEventcalendar().deleteEventcalendar().cancelEventcalendar().respondToEventcalendar().declineProposalcalendar().listFeedscalendar().createFeedcalendar().resetFeedcalendar().deleteFeedcalendar().listSubscriptionscalendar().createSubscriptioncalendar().updateSubscriptioncalendar().refreshSubscriptioncalendar().deleteSubscriptioncalendar().importIcscalendar().listImportscalendar().listAllImportscalendar().iterateImportscalendar().getImportcalendar().undoImport
calendar().listEvents
List one page of event occurrences inside a time window
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.
Parámetros
options.fromInstant or StringObligatorioStart of the window.
options.toInstant or StringObligatorioEnd of the window, after
fromand at most 366 days later.options.timezoneStringIANA zone such as
Europe/London, at most 64 characters. Defaults toUTC.options.limitintOccurrences per page, a whole number from 1 to 100. The server defaults to 25.
options.cursorStringThe
nextCursorof the previous page, sent with the same window. It is opaque, so never build one yourself.options.apiKeyStringOverrides the client's API key for this call only.
Devuelve
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.
Ejemplo
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());}Notas
myPartstatis 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
statusforCANCELLED.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.
También disponible en
calendar().listAllEvents
Collect every occurrence inside a time window into one list
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.
Parámetros
options.fromInstant or StringObligatorioStart of the window.
options.toInstant or StringObligatorioEnd of the window, after
fromand at most 366 days later.options.timezoneStringIANA zone such as
Europe/London, at most 64 characters. Defaults toUTC.options.limitintPage size for each request, 1 to 100. The server defaults to 25.
options.cursorStringStarts the walk from this cursor instead of the start of the window.
options.apiKeyStringOverrides the client API key for every page of this walk.
Devuelve
A list of occurrence maps holding every occurrence in the window, earliest first.
Ejemplo
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"));}Notas
If any page fails the call throws and the occurrences already fetched are discarded.
También disponible en
calendar().iterateEvents
Stream the occurrences inside a time window one at a time
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.
Parámetros
options.fromInstant or StringObligatorioStart of the window.
options.toInstant or StringObligatorioEnd of the window, after
fromand at most 366 days later.options.timezoneStringIANA zone such as
Europe/London, at most 64 characters. Defaults toUTC.options.limitintPage size per request, 1 to 100. The server defaults to 25.
options.cursorStringStarts the walk from this cursor instead of the start of the window.
options.apiKeyStringOverrides the client API key for every page of this walk.
Devuelve
A PagedIterable that yields one occurrence map per step.
Ejemplo
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"));}Notas
A page request that fails throws out of the
forloop, after every occurrence of the pages before it has been yielded.
También disponible en
calendar().getEvent
Read an event with its attendees
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.
Parámetros
idStringObligatorioEvent id, the
eventIdof an occurrence, such ascal_followed by 24 hex characters.options.apiKeyStringOverrides the client's API key for this call only.
Devuelve
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.
Ejemplo
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"));Notas
status,transparencyandvisibilitycarry iCalendar values, and default toCONFIRMED,OPAQUEandPUBLIC.An attendee's
partstatdefaults toNEEDS-ACTIONandroletoREQ-PARTICIPANTuntil a response is recorded.
También disponible en
calendar().getEventIcs
Download an event as an iCalendar document
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.
Parámetros
idStringObligatorioEvent id, the
eventIdof an occurrence.options.apiKeyStringOverrides the client's API key for this call only.
Devuelve
A string, the iCalendar text from BEGIN:VCALENDAR to END:VCALENDAR.
Ejemplo
String ics = client.calendar().getEventIcs("cal_8d3f0a2b9c4e41f7a6b5c2d1"); System.out.println(ics);Notas
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
TZIDand aVTIMEZONEthat carries the rules of that zone, and all day events asDATEvalues.A narrowed key gets a 404 on the same terms as
getEvent.
También disponible en
calendar().createEvent
Put an event on the calendar
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.
Parámetros
body.summaryStringObligatorioThe title, 1 to 255 characters.
body.startInstant or StringObligatorioWhen it starts, an
Instantor ISO 8601 with a zone. AnInstantis sent as an instant in UTC.body.endInstant or StringObligatorioWhen it ends, after
startand at most two years later.body.descriptionStringNotes about the event, up to 8,000 characters.
body.locationStringWhere it is: a room, an address or a link.
body.urlStringA link that belongs to the event.
body.allDaybooleanWhether it fills whole days.
startandendthen mark the days.body.timezoneStringThe IANA zone the event belongs to,
UTCunless you say.body.recurrenceStringAn RRULE such as
FREQ=WEEKLY;BYDAY=MOwhen it repeats.body.attendeesList<Map<String, Object>>Up to 200 people to invite, each a map with
emailand, if you like,nameandoptional.body.remindersList<Map<String, Object>>Up to five reminders, each a map with
minutesBeforeand, if you like,action(DISPLAY,EMAILorAUDIO, as inuk.openemail.constants.CalendarReminderActions).body.transparencyStringOPAQUEshows you busy andTRANSPARENTfree, as inuk.openemail.constants.CalendarTransparencies.body.visibilityStringPUBLIC,PRIVATEorCONFIDENTIAL, as inuk.openemail.constants.CalendarVisibilities.body.sendInvitesbooleanFalse keeps the change to your own calendar, and sends nothing.
body.fromStringThe address the invitations come from. It has to be one the key may send as.
options.apiKeyStringOverrides the client's API key for this call only.
Devuelve
A map for the new event, shaped like the one calendar().getEvent returns, with its attendees and their responses.
Ejemplo
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"));Notas
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
fromis refused with 403from_address_forbidden, and an event with attendees and nofromwith 422invalid_parameter. Invitations withoutemails:sendare a 403insufficient_scope.
También disponible en
calendar().updateEvent
Change an event
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.
Parámetros
idStringObligatorioEvent id, the
eventIdof an occurrence, such ascal_followed by 24 hex characters.patch.summaryStringThe title, 1 to 255 characters.
patch.startInstant or StringWhen it starts, an
Instantor ISO 8601 with a zone. AnInstantis sent as an instant in UTC.patch.endInstant or StringWhen it ends, after
startand at most two years later.patch.descriptionStringNotes about the event, up to 8,000 characters.
patch.locationStringWhere it is: a room, an address or a link.
patch.urlStringA link that belongs to the event.
patch.allDaybooleanWhether it fills whole days.
startandendthen mark the days.patch.timezoneStringThe IANA zone the event belongs to,
UTCunless you say.patch.recurrenceStringAn RRULE such as
FREQ=WEEKLY;BYDAY=MOwhen it repeats.patch.attendeesList<Map<String, Object>>Up to 200 people to invite, each a map with
emailand, if you like,nameandoptional. It replaces the whole list.patch.remindersList<Map<String, Object>>Up to five reminders, each a map with
minutesBeforeand, if you like,action(DISPLAY,EMAILorAUDIO, as inuk.openemail.constants.CalendarReminderActions).patch.transparencyStringOPAQUEshows you busy andTRANSPARENTfree, as inuk.openemail.constants.CalendarTransparencies.patch.visibilityStringPUBLIC,PRIVATEorCONFIDENTIAL, as inuk.openemail.constants.CalendarVisibilities.patch.sendInvitesbooleanFalse keeps the change to your own calendar, and sends nothing.
patch.fromStringThe address the invitations come from. It has to be one the key may send as.
options.apiKeyStringOverrides the client's API key for this call only.
Devuelve
A map for the event as it stands after the change, shaped like the one calendar().getEvent returns, with sequence one higher.
Ejemplo
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"));Notas
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 withrespondToEventinstead. An event the key does not reach is a 404.
También disponible en
calendar().deleteEvent
Remove an event from the calendar
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.
Parámetros
idStringObligatorioEvent id, the
eventIdof an occurrence, such ascal_followed by 24 hex characters.options.apiKeyStringOverrides the client's API key for this call only.
Devuelve
A map with object, id and deleted set to true.
Ejemplo
Map<String, Object> result = client.calendar().deleteEvent("cal_3f9a1c7e5b2d48a06c1e9f4b"); System.out.println(result.get("id"));Notas
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.
También disponible en
calendar().cancelEvent
Call off a meeting
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.
Parámetros
idStringObligatorioEvent id, the
eventIdof an occurrence, such ascal_followed by 24 hex characters.body.fromStringThe address the cancellation comes from. It has to be one the key may send as.
options.apiKeyStringOverrides the client's API key for this call only.
Devuelve
A map for the event, shaped like the one calendar().getEvent returns, with status set to CANCELLED.
Ejemplo
Map<String, Object> event = client.calendar().cancelEvent("cal_3f9a1c7e5b2d48a06c1e9f4b", Body.of("from", "[email protected]")); System.out.println(event.get("status"));Notas
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.
También disponible en
calendar().respondToEvent
Answer an invitation
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.
Parámetros
idStringObligatorioEvent id, the
eventIdof an occurrence, such ascal_followed by 24 hex characters.body.responseStringObligatorioACCEPTED,DECLINEDorTENTATIVE, as inuk.openemail.constants.CalendarResponses.body.respondingAsStringWhich of your invited addresses answers, when there is more than one.
body.proposedStartInstant or StringA new start to propose with your answer, an
Instantor ISO 8601 with a zone, sent together withproposedEnd. AnInstantis sent as an instant in UTC.body.proposedEndInstant or StringThe end of the proposed time.
options.apiKeyStringOverrides the client's API key for this call only.
Devuelve
A map for the event, shaped like the one calendar().getEvent returns, with your answer on your attendee row.
Ejemplo
Map<String, Object> event = client.calendar().respondToEvent("cal_3f9a1c7e5b2d48a06c1e9f4b", Body.of("response", "ACCEPTED")); System.out.println(event.get("attendees"));Notas
An event that invited none of the addresses the key may send as is refused with 403
not_invited, and a cancelled meeting with 409event_cancelled.When the organiser cannot be reached, nothing changes and the call is a 409
reply_not_sent.With
proposedStartandproposedEndthe organiser gets a counter-proposal, as Propose a new time sends from Google Calendar and Outlook, and decides whether to move the meeting.
También disponible en
calendar().declineProposal
Decline a proposed time
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.
Parámetros
idStringObligatorioEvent id, the
eventIdof an occurrence, such ascal_followed by 24 hex characters.body.attendeeStringObligatorioThe guest whose proposal you decline, by email address.
body.fromStringThe address the answer is sent from, when it is not the organising address.
options.apiKeyStringOverrides the client's API key for this call only.
Devuelve
A map for the event, shaped like the one calendar().getEvent returns, with the guest's proposedStart and proposedEnd cleared.
Ejemplo
Map<String, Object> event = client.calendar().declineProposal("cal_3f9a1c7e5b2d48a06c1e9f4b", Body.of("attendee", "[email protected]")); System.out.println(event.get("summary") + " keeps its time");Notas
A guest who has not proposed a new time is refused with 404
proposal_not_found, and an event somebody else organises with 403not_organizer.
También disponible en
calendar().listFeeds
List calendar links
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.
Parámetros
options.apiKeyStringOverrides the client's API key for this call only.
Devuelve
A list of maps, each with id, name, mode, url, webcalUrl and when calendar apps last read it.
Ejemplo
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"));}Notas
A key limited to particular addresses or domains is refused with 422
capability_unsupported, because a link covers the whole calendar.
También disponible en
calendar().createFeed
Create a calendar link
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.
Parámetros
body.nameStringObligatorioThe name calendar apps show for the calendar, up to 100 characters.
body.modeStringObligatoriofullfor every detail,busyfor busy times only, as inuk.openemail.constants.CalendarFeedModes.options.apiKeyStringOverrides the client's API key for this call only.
Devuelve
A map for the link with the new url and webcalUrl.
Ejemplo
Map<String, Object> feed = client.calendar().createFeed(Body.of("name", "Work (busy)", "mode", "busy")); System.out.println(feed.get("url"));Notas
One person may keep 10 links. One more is refused with 409
calendar_feed_limit.
También disponible en
calendar().resetFeed
Reset a calendar link
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.
Parámetros
idStringObligatorioCalendar link id,
cfd_followed by 24 hex characters.options.apiKeyStringOverrides the client's API key for this call only.
Devuelve
A map for the link with its new url and webcalUrl.
Ejemplo
Map<String, Object> feed = client.calendar().resetFeed("cfd_3f9a1c7e5b2d48a06c1e9f4b"); System.out.println(feed.get("url"));Notas
A link that is not yours is a 404
calendar_feed_not_found.
También disponible en
calendar().deleteFeed
Delete a calendar link
Map<String, Object> deleteFeed(String id, RequestOptions options)Turns a calendar link off for good. Calendar apps that subscribed to it stop getting updates.
Parámetros
idStringObligatorioCalendar link id,
cfd_followed by 24 hex characters.options.apiKeyStringOverrides the client's API key for this call only.
Devuelve
A map with object, id and deleted set to true.
Ejemplo
Map<String, Object> result = client.calendar().deleteFeed("cfd_3f9a1c7e5b2d48a06c1e9f4b"); System.out.println(result.get("id"));Notas
A link that is not yours is a 404
calendar_feed_not_found.
También disponible en
calendar().listSubscriptions
List calendar subscriptions
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.
Parámetros
options.apiKeyStringOverrides the client's API key for this call only.
Devuelve
A list of maps, each with name, url, color, status, lastError and how many events it holds.
Ejemplo
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"));}Notas
statusisfailingwhile reads fail and are retried, andstoppedafter ten failures in a row until you refresh it.
También disponible en
calendar().createSubscription
Subscribe to a calendar
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.
Parámetros
body.urlStringObligatorioThe calendar link,
https,httporwebcal.body.nameStringThe name to show, up to 100 characters.
body.colorStringThe colour of its events, as in
uk.openemail.constants.CalendarColors.options.apiKeyStringOverrides the client's API key for this call only.
Devuelve
A map for the subscription with its first events read.
Ejemplo
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"));Notas
An address that does not answer with a calendar is refused with 422
calendar_subscription_unreadable, and one you already subscribe to with 409calendar_subscription_exists.One person may subscribe to 20 calendars.
También disponible en
calendar().updateSubscription
Change a calendar subscription
Map<String, Object> updateSubscription(String id, Map<String, Object> patch, RequestOptions options)Renames a subscription or gives it another colour.
Parámetros
idStringObligatorioSubscription id,
csb_followed by 24 hex characters.patch.nameStringThe new name, up to 100 characters.
patch.colorStringThe new colour, as in
uk.openemail.constants.CalendarColors.options.apiKeyStringOverrides the client's API key for this call only.
Devuelve
A map for the subscription as it stands now.
Ejemplo
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"));Notas
A subscription that is not yours is a 404
calendar_subscription_not_found.
También disponible en
calendar().refreshSubscription
Refresh a calendar subscription
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.
Parámetros
idStringObligatorioSubscription id,
csb_followed by 24 hex characters.options.apiKeyStringOverrides the client's API key for this call only.
Devuelve
A map for the subscription after the read, with status and lastError.
Ejemplo
Map<String, Object> subscription = client.calendar().refreshSubscription("csb_3f9a1c7e5b2d48a06c1e9f4b"); System.out.println(subscription.get("lastError"));Notas
A calendar read less than a minute ago is refused with 429
calendar_subscription_refresh_too_soon.
También disponible en
calendar().deleteSubscription
Unsubscribe from a calendar
Map<String, Object> deleteSubscription(String id, RequestOptions options)Removes a subscription and every event it brought onto your calendar.
Parámetros
idStringObligatorioSubscription id,
csb_followed by 24 hex characters.options.apiKeyStringOverrides the client's API key for this call only.
Devuelve
A map with object, id and deleted set to true.
Ejemplo
Map<String, Object> result = client.calendar().deleteSubscription("csb_3f9a1c7e5b2d48a06c1e9f4b"); System.out.println(result.get("id"));Notas
A subscription that is not yours is a 404
calendar_subscription_not_found.
También disponible en
calendar().importIcs
Import a calendar file
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.
Parámetros
databyte[]ObligatorioThe .ics file: a byte array.
options.filenameStringThe name to show for the file in the list of imports, at most 255 characters.
options.apiKeyStringOverrides the client API key for this call only.
Devuelve
A map with status set to queued.
Ejemplo
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"));Notas
A body that is not an iCalendar file is a 400
not_a_calendar_file, an empty one a 400item_import_empty, and one holding more than 25,000 events a 400too_many_events.A file over 10 MB is a 413
item_import_too_large.To send text you already hold, such as what
getEventIcsreturns, encode it first withtext.getBytes(StandardCharsets.UTF_8).An upload that outlasts the client
timeoutfails as a network error, so raise it on the client for a large file on a slow connection.Not retried automatically.
También disponible en
calendar().listImports
List calendar imports
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.
Parámetros
options.limitintImports per page, a whole number from 1 to 100. The server defaults to 25.
options.cursorStringThe
nextCursorfrom the previous page. Never build one yourself.options.apiKeyStringOverrides the client API key for this call only.
Devuelve
A Page of maps with items, hasMore and nextCursor.
Ejemplo
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());}Notas
sourceisfilefor an upload.takeout,caldavandmicrosoftcame 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 aRetry-Afterof a minute or less.
También disponible en
calendar().listAllImports
Collect every calendar import into one list
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.
Parámetros
options.limitintPage size per request, from 1 to 100, defaulting to 25 on the server.
options.cursorStringA cursor from an earlier page to start after.
options.apiKeyStringOverrides the client API key for every page of this walk.
Devuelve
A list of maps holding every import across all pages.
Ejemplo
List<Map<String, Object>> imports = client.calendar().listAllImports(); for (Map<String, Object> item : imports) { System.out.println(item.get("counts"));}Notas
A failure on any page rejects the whole call, and the imports already fetched are discarded.
También disponible en
calendar().iterateImports
Stream calendar imports one at a time
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.
Parámetros
options.limitintPage size per request, from 1 to 100, defaulting to 25 on the server.
options.cursorStringA cursor from an earlier page to start after.
options.apiKeyStringOverrides the client API key for every page of this walk.
Devuelve
A PagedIterable of maps yielding one import per step.
Ejemplo
for (Map<String, Object> item : client.calendar().iterateImports()) { System.out.println(item.get("status") + " " + item.get("id") + " " + item.get("counts"));}Notas
The generator is lazy, so an abandoned loop costs only the pages you consumed.
También disponible en
calendar().getImport
Get a calendar import
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.
Parámetros
idStringObligatorioCalendar import id,
iimp_followed by 24 hex characters.options.apiKeyStringOverrides the client API key for this call only.
Devuelve
A map with status, counts, report, undoable and when it started, finished and was undone.
Ejemplo
Map<String, Object> item = client.calendar().getImport("iimp_3f9c2a7b1e4d8f60a5c7b92d"); System.out.println(item.get("status") + " " + item.get("counts") + " " + item.get("report"));Notas
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 aRetry-Afterof a minute or less.
También disponible en
calendar().undoImport
Remove what a calendar import added
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.
Parámetros
idStringObligatorioCalendar import id,
iimp_followed by 24 hex characters.options.apiKeyStringOverrides the client API key for this call only.
Devuelve
A map with status set to undone and undoneAt set.
Ejemplo
Map<String, Object> undone = client.calendar().undoImport("iimp_3f9c2a7b1e4d8f60a5c7b92d"); System.out.println(undone.get("status") + " " + undone.get("undoneAt") + " " + undone.get("counts"));Notas
An import that is still running, or was already removed, is a 409
item_import_not_undoable.undoableon 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.