Jump to: navigation, search

Business Calendars

API Method Syntax Request Body Response Body HTTP Status Codes Notes
Query Business Calendars GET [+]Show N/A [+]Show
  • 200 OK—Response body provided
  • 401 Unauthorized—APIToken not valid
  • 403 Forbidden—User does not have permission for the specified tenant ID, or does not have the correct permission for this operation.
  • 404 Not Found—could not find specified package ID.
  • 503—Service Unavailable
Need CALENDAR_VIEW permission.
Query Business Calendar Body GET [+]Show N/A [+]Show
  • 200 OK—Response body provided
  • 401 Unauthorized—APIToken not valid
  • 403 Forbidden—User does not have permission for the specified tenant ID, or does not have the correct permission for this operation.
  • 404 Not Found—could not find specified calendar ID
  • 503—Service Unavailable
For exceptions, the following applies:

type

  • HOLIDAY (entire day is non-work)
  • TIME_CHANGE (working range specified)

placement

  • FIXED - A single date (Jan 1, 2015)
    • fixedDate contains timestamp
  • ANNUAL - Same day each year (Dec 25)
    • annualMonth: 1-12
    • annualDay: 1-31
  • RELATIVE - 1st Thursday of each month
    • relativeType
      • EVERY
      • FIRST
      • SECOND
      • THIRD
      • FOURTH
      • LAST
    • relativeDayOfWeek: 1-7 (1=Sun)
      • relativeMonth: 1-31, 0 if all months

For TIME_CHANGE:

  • timeChangeStartHour: 0-23
  • timeChangeStartMin: 0-59
  • timeChangeStopHour: 0-23
  • timeChangeStopMin: 0-59
Create Calendar POST [+]Show [+]Show [+]Show
  • 201 Created—Response body provided
  • 401 Unauthorized—APIToken not valid
  • 403 Forbidden—User does not have permission for the specified tenant, or does not have proper permission to perform this operation.
  • 422 Unprocessable Entry—Field Validation Error
[+]Show
  • 503—Service Unavailable
User must have CALENDAR_CREATE and CALENDAR_VIEW permissions. Response will include calenderId which can be used on subsequent requests. WeekStarts / WeekEnds

1 - Sunday
2 - Monday
...
7 - Saturday

dayStartsHour : 0-23
dayStartsMin : 0-59
dayEndsHour : 0-23
dayEndsMin : 0-59
timeZoneId - As returned by Java's TimeZone class

Lock Calendar GET [+]Show N/A N/A
  • 204 No Content—Request was successful
  • 401 Unauthorized—APIToken not valid
  • 403 Forbidden—User does not have permission for the specified tenant ID, or does not have the correct permission for this operation.
  • 404 Not Found—could not find specified package ID or calendar ID.
  • 412 Precondition failed—another user holds the lock for this resource
  • 503—Service Unavailable
User must have CALENDAR_VIEW and CALENDAR_MODIFY permissions. User can LOCK (obtain exclusive access) to a calendar by issuing this API. The LOCK will be in effect until UNLOCKED by the user, or until the user's APIToken times out (session timeout, default 30 min). A lock is required to modify or delete the calendar.
Unlock Calendar GET [+]Show N/A N/A
  • 204 No Content—Request was successful
  • 401 Unauthorized—APIToken not valid
  • 403 Forbidden—User does not have permission for the specified tenant ID.
  • 404 Not Found—could not find specified package ID or calendar ID.
  • 503—Service Unavailable
Unlocks a calendar previously locked by this user (APIToken).
Modify Calendar PUT [+]Show [+]Show [+]Show
  • 200 OK—Response body provided
  • 401 Unauthorized—APIToken not valid
  • 403 Forbidden—User does not have permission for the specified tenant, or does not have proper permission to perform this operation.
  • 412 Precondition Failed—Calendar was not locked first
  • 422 - Unprocessable Entry—Field Validation Error
[+]Show
  • 503—Service Unavailable
User must have CALENDAR_MODIFY permission. User must have LOCK. The following fields can be updated on a calendar (any other fields passed in will be ignored):
  • name
  • weekStarts
  • weekEnds
  • dayStartsHour
  • dayStartsMin
  • dayEndsHour
  • dayEndsMin
  • timeZoneId
Modify Calendar Body PUT [+]Show [+]Show [+]Show
  • 200 OK—Response body provided
  • 401 Unauthorized—APIToken not valid
  • 403 Forbidden—User does not have permission for the specified tenant, or does not have proper permission to perform this operation.
  • 412 Precondition Failed—Calendar was not locked first
  • 422 Unprocessable Entry—Field Validation Error
[+]Show

Repeated for each field:

  • 1002fixedDatefixedDate must be specified with type of FIXED
  • 1003annualMonth—Invalid value. Must be between 1 and 12
  • 1004annualDay—Invalid value. Must be between 1 and 31.
  • 1005relativeType—Invalid value, must be EVERY, FIRST, SECOND, THIRD, FOURTH, or LAST
  • 1006relativeDayOfWeek—Invalid value. Must be between 1 and 7
  • 1007relativeMonth—Invalid value. Must be between 1 and 12
  • 1008timeChangeStartHour—Invalid value. Must be between 0 and 23
  • 1009timeChangeStartMin—Invalid value. Must be between 0 and 59
  • 1010timeChangeStopHour—Invalid value. Must be between 0 and 23
  • 1011timeChangeStopMin—Invalid value. Must be between 0 and 59
  • 503—Service Unavailable
User must have CALENDAR_MODIFY permission. User must have LOCK. User should pass in structure containing entire calendar body (exceptions).

This is a complete replacement of current calendar body (not just changes). Updated structure is returned in response

Delete Calendar DELETE [+]Show N/A N/A
  • 204 No Content—returned if successful operation
  • 401 Unauthorized—APIToken not valid
  • 403 Forbidden—User does not have permission for the specified tenant or does not have proper permission to perform this operation.
  • 404 Not Found—could not find specified package ID or calendarID.
  • 412 Precondition Failed—Calendar was not locked first
  • 503—Service Unavailable
Must have CALENDAR_DELETE permission. Must have lock on Calendar.
This page was last edited on May 24, 2016, at 08:08.
Comments or questions about this documentation? Contact us for support!