List calendars
const url = 'https://calendar.work.optidata.cloud/api/calendars';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 \ --header 'Authorization: Bearer <token>'Every calendar the authenticated user can see: the ones they own, plus the ones other users have shared with them. Calendars the user owns come first; shared ones follow.
The user’s primary calendar is the one with isHomeCalendar: true. It
cannot be renamed or deleted, which is why it also reports
isDeletable: false.
Authorizations
Section titled “Authorizations”Responses
Section titled “ Responses ”The calendars visible to the caller.
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
{ "calendars": [ { "id": "10", "sharedId": null, "uuid": "4efee8cc-dc50-4974-ac04-fa4a8510cf29", "name": "Calendar", "color": "#9C5DEF", "exportUrl": null, "folderPath": "/Calendar", "parentFolderId": "1", "parentFolderUuid": "467ce5ad-84c6-4825-889b-9a28e96bbe4a", "linkedCalendarId": null, "linkedCalendarUuid": null, "ownerZid": null, "ownerEmail": null, "userRole": "owner", "isHomeCalendar": true, "isDeletable": false, "isShared": false, "isBroken": false, "permissions": [ { "role": "owner", "memberType": "user", "memberZid": "20d77f6c-91f6-4e39-9488-bb7fe302d65d", "memberEmail": "jane.doe@acme.example", "memberName": "Jane Doe", "memberAvatarUrl": null, "memberOptiworkIdentifier": "9e926fb1-e1ff-4fc9-81a1-5740f10ba57f" } ], "ownerName": null }, { "id": "454", "sharedId": null, "uuid": "2ca985db-cc36-4627-aef2-3ee45fdf0fdd", "name": "Team planning", "color": "#EBBC00", "folderPath": "/Team planning", "userRole": "owner", "isHomeCalendar": false, "isDeletable": true, "isShared": false, "isBroken": false, "permissions": [] } ]}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"}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."}