Skip to main content

Calendar Service

The calendar resource contains all the public and private calendars

Calendar REST API

The Calendar REST API is a full CRUD API allowing you to search and filter calendars as well as update, version and delete them. It is accessed through the following URL:

https://api.opendatadsl.com/api/calendar

The API consists of the following calls:

MethodPathExampleDescription
GETGet the build information for this service
GET{release}/{source}'v1/public' 'v1/private'List public or private calendars
GET{release}/{source}/{key}v1/private/TESTRetrieve a single calendar using it’s unique id
GET{release}/{source}/{key}/{version}v1/private/TEST/1Retrieve a version of a single calendar
GET{release}/{source}/{key}/*v1/private/TEST/*Get a list of versions for a specific calendar
PUT{release}/{source}/{key}/{version}/{tag}v1/private/TEST/1/PRODTag a version with a name (which can be used instead of the version number when retrieving it)
POST{release}v1Create or update an calendar, the calendar is the body of the POST request
DELETE{release}/{source}/{key}v1/private/TESTRollback to the previous version of a calendar, if it is the only version then the calendar will be deleted
DELETE{release}/{source}/{key}/{version}v1/private/TEST/1Delete a specific version of a calendar
DELETE{release}/{source}/{key}/*v1/private/TEST/*Fully delete a calendar, including all versions

Entities

Calendar Entity

The calendar entity contains the following information:

NameDescriptionType
_idUnique id for the calendar (or object id if this is not the latest version of the calendar)String
_typeThe type of the entity - always VarCalendarString
calendarThe definition of the calendarCalendar
_oidThe id of the calendar - will match _id if this is the latest version of the calendarString
_timestampTimestamp of when this calendar version was createdString(DateTime)
_userThe user id (email) of the user that created this calendar verisionString
_tagA list of version tag names for this calendar versionString[]
_versionThe version number of this calendar versionint

HolidayCalendar

The entity definition of a holiday calendar:

NameDescriptionType
_idUnique id for the holiday calendarString
_typeThe entity type - always HolidayCalendarString
ruleThe rule type - always Holiday CalendarString
rulesThe list of rulesHolidayRule[]

HolidayRule

The main entity definition of a holiday rule:

NameDescriptionType
ruleThe type of ruleString
codeThe code name of the ruleString
nameThe name of the ruleString

A holiday rule can contain more fields based on the type - the following entity definitions extend the above HolidayRule entity:

HolidayRule - Every

Defining a specific day of the week to always be a holiday

NameDescriptionType
dayThe day nameString

HolidayRule - Actual

Defining a specific day or days of the year to always be a holiday

NameDescriptionType
domThe start day of the monthint
todomThe end day of the monthint
monthThe start monthint
tomonthThe end monthint
optionsA list of options that modify this ruleoptions

HolidayRule - Last

Defining the last specific named day of a specific month

NameDescriptionType
dayThe named dayString
monthThe month numberint
optionsA list of options that modify this ruleoptions

HolidayRule - Ordinal

Defining the nth specific named day or a specific month

NameDescriptionType
ordinalThe ordinal or nth specific day of the monthint
dayThe named dayString
monthThe month numberint
optionsA list of options that modify this ruleoptions

HolidayRule - Named

There are also certain fixed named holidays - see Holiday Calendar

Options

The options definition for modifying a rule

NameDescriptionType
shiftOnSaturdayThe number of days to move backwards or forwards if the holiday lands on a Saturdayint
shiftOnSundayThe number of days to move backwards or forwards if the holiday lands on a Sundayint
shiftOnMondayThe number of days to move backwards or forwards if the holiday lands on a Mondayint
validFromYearThe first year that this rule is valid fromint
validToYearThe last year that this rule is valid toint
repeatsThe repeats every n years valueint
repeatStartYearThe year in which the repeats value startsint