You can use this REST API to develop integrations between Company Calendar Planner for Jira and other applications or systems. This page documents the available REST resources along with expected HTTP responses and sample requests.
To use REST API, an admin has to generate a token tied either to specific calendars or all calendars. It’s recommended to assign minimum calendars per token and to create "All Calendars" tokens only when it’s needed.
URI Structure
To use REST API, your application will make an HTTP request and parse the response.
Since the Cloud version of the app is hosted in the Cloud, while the Server and Data Center versions reside on the same server as Jira, there are different URLs for REST API.
For Jira Cloud REST API URIs start with:
https://ccj.brizoit.com/ccj/rest/brizo-calendar
For Jira Server REST API URIs start with your Jira URL followed by /rest/brizo-calendar
JIRA-SERVER-URL/rest/brizo-calendar
Jira URL can be copied from the browser or checked in Administration -> System -> General configuration, Base URL setting:
Authentication
Requests to the REST points should be authenticated by Bearer authentication (also known as token authentication). To do so, the clients must send the token in the Authorization header when making requests:
Authorization: Bearer <token>
When no token or wrong token is passed all REST resources return 401 error code.
REST resources
GET /api/1/calendar
Returns the list of calendars tied for the passed token.
Successful response brings JSON with calendars associated with the passed token:
See the response sample:
GET /api/1/calendar/{calendarId}
Returns the calendar for the given calendar id.
In addition to properties returned by GET /api/1/calendar
, this method brings permissions related properties.
Successful response brings JSON with a calendar:
See the response sample:
404 status code
is returned for non-existing calendarId or when the calendarId is not associated with the token.
GET /api/1/source/{sourceId}
Returns the source for the given source id.
Successful response brings JSON with a source representation:
See the response sample:
404 status code
is returned for non-existing sourceId or when the sourceId belongs to a calendar that is not associated with the token.
POST /api/1/event/search
Searches for events.
Only events from sources with type key vacation, sickness, trip, meeting or custom are returned.
JSON body parameters:
startDate long Unix milliseconds timestamp. Mutually exclusive with startDateIso and endDateIso. endDate long Unix milliseconds timestamp. Mutually exclusive with startDateIso and endDateIso. startDateIso string ISO 8601 date and time. Mutually exclusive with startDate and endDate. endDateIso string Unix milliseconds timestamp. Mutually exclusive with startDateIso and endDateIso. calendarId long Id of the calendar to fetch events from. Mutually exclusive with sourceId. sourceId long Id of the source to fetch events from. Mutually exclusive with calendarId.
Interval between start and end dates should be less than 92 days (i.e. a quarter).
JSON body parameters samples:
Period passed as Unix milliseconds and calendarId:
{ "startDate": 1672531200000, "endDate": 1680307200000, "calendarId": 1959 }
Here:
- startDate corresponds to Sun Jan 01 2023 00:00:00 GMT
- endDate corresponds to Sat Apr 01 2023 00:00:00 GMT
2. Period passed as ISO dates and sourceId:
{ "startDateIso": "2023-01-01T00:00:00-05:00", "endDateIso": "2023-04-01T00:00:00-04:00", "sourceId": 5655 }
Here:
- startDateIso corresponds to Sun Jan 01 2023 00:00:00 EST
- endDateIso corresponds to Sat Apr 01 2023 00:00:00 DST
Successful response brings JSON with matching events:
As for now, values are non-paginated and all matching events are returned. We might introduce the pagination should we see the need.
See the response sample:
400 status code
is returned when parameters validation fails. The status is accompanied with the error messages. E.g.:
404 status code
is returned for non-existing calendarId or sourceId or when the calendarId or sourceId correspond to a calendar that is not associated with the token.
In case you need to create or edit events via the REST API, please add an appropriate comment under - CJ-4727Getting issue details... STATUS .
In case you need to create or edit calendars or sources via the REST API, please add an appropriate comment under - CJ-4733Getting issue details... STATUS .
You might need to log-out from our Service Desk https://brizoit.atlassian.net/servicedesk to comment under these public issues. This is a known Jira bug.