Read a calendar
const url = 'https://calendar.work.optidata.cloud/api/calendars/454';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://calendar.work.optidata.cloud/api/calendars/454 \ --header 'Authorization: Bearer <token>'The full record of one calendar, including the permissions list — who it
is shared with and at which role.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”Id of the calendar. Read it from GET /calendars.
Responses
Section titled “ Responses ”The calendar.
object
A calendar the caller owns or has been given access to.
object
Id of the calendar, as digits.
For a calendar shared with the caller, its {ownerZid}:{calendarId}
identifier. null for a calendar the caller owns.
Hex colour used to render the calendar.
Populated only when a subscription feed has been generated.
For a shared calendar, its id in the owner’s account.
true for the user’s primary calendar, which cannot be renamed or
deleted.
true when the calendar belongs to somebody else.
true when a shared calendar can no longer be resolved — usually
because the owner revoked access or deleted it.
Who the calendar is shared with, and at which role.
One person’s access to a calendar.
object
What a member may do with a calendar. viewer reads it, manager also
creates and edits events and may answer invitations on the owner’s behalf,
admin additionally manages sharing, and owner is the person the
calendar belongs to.
user is somebody with an Optiwork account in the tenant, group a user
group, and guest an address outside it.
Mailbox identifier of the member.
Address of the member.
Optiwork identifier of the member — the value to send back as
optiworkIdentifier.
Examples
{ "calendar": { "id": "454", "sharedId": null, "uuid": "2ca985db-cc36-4627-aef2-3ee45fdf0fdd", "name": "Team planning", "color": "#EBBC00", "folderPath": "/Team planning", "parentFolderId": "1", "userRole": "owner", "isHomeCalendar": false, "isDeletable": true, "isShared": false, "isBroken": false, "permissions": [ { "role": "viewer", "memberType": "user", "memberZid": "2ed19d21-38bd-4ff1-bbc0-a30fc832e4e6", "memberEmail": "john.smith@acme.example", "memberName": "John Smith", "memberAvatarUrl": null, "memberOptiworkIdentifier": "9ef34ce3-3b69-4762-b5e8-045499390ce6" } ] }}Missing, malformed or expired authentication key.
Authentication failures use an error key rather than message.
object
Examples
No bearer token sent
{ "error": "JWT passport exception: Missing bearer token in request"}The calendar could not be read — it does not exist, or is no longer reachable.
Failures raised by the calendar layer itself — a permission refusal, or a
calendar or event that cannot be read. help is a hint for the end user
and is often empty.
object
What went wrong.
Repeats the HTTP status code.
Suggested next step, or an empty string.
Examples
{ "error": "Cannot get calendar folder: no such folder id: 99999999", "status": 422, "help": ""}Rate limit exceeded. Retry after the window resets.
Generic error envelope used by policy, binding and framework failures.
object
Human-readable description of the failure.
Examples
{ "message": "Too Many Attempts."}