API
|
Method
|
Syntax
|
Request Body
|
Response Body
|
HTTP Status Codes
|
Notes
|
Query Business Calendars
|
GET
|
[+]Show
/grs/v1/tenant/{tenantId}/package/{packageId}/calendars
|
N/A
|
[+]Show
"calendars": [
{
"calendarId": "dcc4a39b-3442-4408-a907-b85c44663681",
"extCalendarId": "Calendar_117",
"name": "Dad's Dating Calendar",
"locked": false,
"lockOwner": null,
"weekStarts": 6,
"weekEnds": 7,
"dayStartsHour": 17,
"dayStartsMin": 30,
"dayEndsHour": 23,
"dayEndsMin": 0,
"timeZoneId": "EST"
},
{
"calendarId": "fdc4a39b-3442-4408-a907-b85c44663622",
"extCalendarId": "Calendar_190",
"name": "Another Calendar",
"locked": false,
"lockOwner": null,
"weekStarts": 1,
"weekEnds": 7,
"dayStartsHour": 8,
"dayStartsMin": 30,
"dayEndsHour": 11,
"dayEndsMin": 0,
"timeZoneId": "America/Cayman"
}
]}
|
- 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
/grs/v1/tenant/{tenantId}/package/{packageId}/businesscalendarbody/{calendarId}
|
N/A
|
[+]Show
{
"calendarId":"dcc4a39b-3442-4408-a907-b85c44663681",
"externalId":"Calendar_117",
"name":"Dad's Dating Calendar",
"locked":false,
"lockOwner":null,
"weekStarts":6,
"weekEnds":7,
"dayStartsHour":17,
"dayStartsMin":30,
"dayEndsHour":23,
"dayEndsMin":0,
"timeZoneId":"EST",
"exceptions":[
{
"name":"Christmas",
"type":"HOLIDAY",
"placement":"FIXED",
"fixedDate":30949200000,
"annualMonth":0,
"annualDay":0,
"relativeType":null,
"relativeDayOfWeek":0,
"relativeMonth":0,
"timeChangeStartHour":0,
"timeChangeStartMin":0,
"timeChangeStopHour":0,
"timeChangeStopMin":0
},
{
"name":"It's New Year's Day",
"type":"HOLIDAY",
"placement":"ANNUAL",
"fixedDate":null,
"annualMonth":1,
"annualDay":1,
"relativeType":null,
"relativeDayOfWeek":0,
"relativeMonth":0,
"timeChangeStartHour":0,
"timeChangeStartMin":0,
"timeChangeStopHour":0,
"timeChangeStopMin":0
},
{
"name":"Thanksgiving",
"type":"HOLIDAY",
"placement":"RELATIVE",
"fixedDate":null,
"annualMonth":0,
"annualDay":0,
"relativeType":"FOURTH",
"relativeDayOfWeek":5,
"relativeMonth":11,
"timeChangeStartHour":0,
"timeChangeStartMin":0,
"timeChangeStopHour":0,
"timeChangeStopMin":0
},
{
"name":"My Dad's birthday !",
"type":"HOLIDAY",
"placement":"ANNUAL",
"fixedDate":null,
"annualMonth":5,
"annualDay":20,
"relativeType":null,
"relativeDayOfWeek":0,
"relativeMonth":0,
"timeChangeStartHour":0,
"timeChangeStartMin":0,
"timeChangeStopHour":0,
"timeChangeStopMin":0
},
{
"name":"A Time Change",
"type":"TIME_CHANGE",
"placement":"ANNUAL",
"fixedDate":null,
"annualMonth":1,
"annualDay":9,
"relativeType":null,
"relativeDayOfWeek":0,
"relativeMonth":0,
"timeChangeStartHour":12,
"timeChangeStartMin":30,
"timeChangeStopHour":16,
"timeChangeStopMin":22
},
{
"name":"tc3",
"type":"TIME_CHANGE",
"placement":"FIXED",
"fixedDate":1428984000000,
"annualMonth":0,
"annualDay":0,
"relativeType":null,
"relativeDayOfWeek":0,
"relativeMonth":0,
"timeChangeStartHour":1,
"timeChangeStartMin":33,
"timeChangeStopHour":7,
"timeChangeStopMin":33
},
{
"name":"TC2",
"type":"TIME_CHANGE",
"placement":"RELATIVE",
"fixedDate":null,
"annualMonth":0,
"annualDay":0,
"relativeType":"EVERY",
"relativeDayOfWeek":1,
"relativeMonth":1,
"timeChangeStartHour":3,
"timeChangeStartMin":0,
"timeChangeStopHour":19,
"timeChangeStopMin":0
}
]
}
|
- 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
/grs/v1/tenant/{tenantId}/package/{packageId}/calendar
|
[+]Show
{
"name": "Dad's Calendar",
"weekStarts": 6,
"weekEnds": 7,
"dayStartsHour": 17,
"dayStartsMin": 30,
"dayEndsHour": 23,
"dayEndsMin": 0,
"timeZoneId": "EST"
}
|
[+]Show
{
"calendarId": "Calendar_117",
"name": "Dad's Calendar",
"locked": false,
"lockOwner": null,
"weekStarts": 6,
"weekEnds": 7,
"dayStartsHour": 17,
"dayStartsMin": 30,
"dayEndsHour": 23,
"dayEndsMin": 0,
"timeZoneId": "EST"
}
|
- 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 Entity—Field Validation Error
[+]Show
{
"message": "Validation Failed",
"errors": [
{
"code" : "1000",
"field" : "name",
"message": "name must be specified"
},
{
"code" : "1001",
"field" : "weekStarts",
"message": "weekStarts is invalid. Must be between 1 and 7."
},
{
"code" : "1002",
"field" : "weekEnds",
"message": "weekEnds is invalid. Must be between 1 and 7."
},
{
"code" : "1003",
"field" : "dayStartsHour",
"message": "dayStartsHour is invalid. Must be between 0 and 23."
},
{
"code" : "1004",
"field" : "dayEndsHour",
"message": "dayEndsHour is invalid. Must be between 0 and 23."
},
{
"code" : "1005",
"field" : "dayStartsMin",
"message": "dayStartsMin is invalid. Must be between 0 and 59."
},
{
"code" : "1006",
"field" : "dayEndsMin",
"message": "dayEndsMin is invalid. Must be between 0 and 59."
},
{
"code" : "1007",
"field" : "timeZoneID",
"message": "Unrecognized time zone ID."
}
]
}
|
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
/grs/v1/tenant/{tenantId}/package/{packageId}/lockcalendar/{calendarId}
|
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
/grs/v1/tenant/{tenantId}/package/{packageId}/unlockcalendar/{calendarId}
|
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
/grs/v1/tenant/{tenantId}/package/{packageId}/calendar/{calendarId}
|
[+]Show
{
"weekStarts": 4,
"weekEnds": 5,
"dayStartsHour": 14,
"dayEndsMin": 30,
}
|
[+]Show
{
"calendarId": "Calendar_117",
"name": "Dad's Dating Calendar",
"locked": false,
"lockOwner": null,
"weekStarts": 4,
"weekEnds": 5,
"dayStartsHour": 14,
"dayStartsMin": 30,
"dayEndsHour": 23,
"dayEndsMin": 30,
"timeZoneId": "EST"
}
|
- 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.
- 412 Precondition Failed—Calendar was not locked first
- 422 - Unprocessable Entity—Field Validation Error
[+]Show
{
"message": "Validation Failed",
"errors": [
{
"code" : "1000",
"field" : "weekStarts",
"message": "weekStarts is invalid. Must be between 1 and 7."
},
{
"code" : "1001",
"field" : "weekEnds",
"message": "weekEnds is invalid. Must be between 1 and 7."
},
{
"code" : "1002",
"field" : "dayStartsHour",
"message": "dayStartsHour is invalid. Must be between 0 and 23."
},
{
"code" : "1003",
"field" : "dayEndsHour",
"message": "dayEndsHour is invalid. Must be between 0 and 23."
},
{
"code" : "1004",
"field" : "dayStartsMin",
"message": "dayStartsMin is invalid. Must be between 0 and 59."
},
{
"code" : "1005",
"field" : "dayEndsMin",
"message": "dayEndsMin is invalid. Must be between 0 and 59."
},
{
"code" : "1006",
"field" : "timeZoneID",
"message": "Unrecognized time zone ID."
}
]
}
|
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
/grs/v1/tenant/{tenantId}/package/{packageId}/businesscalendarbody/{calendarId}
|
[+]Show
{
"exceptions":[
{
"name":"Christmas",
"type":"HOLIDAY",
"placement":"FIXED",
"fixedDate":30949200000,
"annualMonth":0,
"annualDay":0,
"relativeType":null,
"relativeDayOfWeek":0,
"relativeMonth":0,
"timeChangeStartHour":0,
"timeChangeStartMin":0,
"timeChangeStopHour":0,
"timeChangeStopMin":0
},
{
"name":"It's New Year's Day",
"type":"HOLIDAY",
"placement":"ANNUAL",
"fixedDate":null,
"annualMonth":1,
"annualDay":1,
"relativeType":null,
"relativeDayOfWeek":0,
"relativeMonth":0,
"timeChangeStartHour":0,
"timeChangeStartMin":0,
"timeChangeStopHour":0,
"timeChangeStopMin":0
}
}
|
[+]Show
{
"calendarId": "Calendar_117",
"name": "Dad's Dating Calendar",
"locked": false,
"lockOwner": null,
"weekStarts": 4,
"weekEnds": 5,
"dayStartsHour": 14,
"dayStartsMin": 30,
"dayEndsHour": 23,
"dayEndsMin": 30,
"timeZoneId": "EST",
"exceptions":[
{
"name":"Christmas",
"type":"HOLIDAY",
"placement":"FIXED",
"fixedDate":30949200000,
"annualMonth":0,
"annualDay":0,
"relativeType":null,
"relativeDayOfWeek":0,
"relativeMonth":0,
"timeChangeStartHour":0,
"timeChangeStartMin":0,
"timeChangeStopHour":0,
"timeChangeStopMin":0
},
{
"name":"It's New Year's Day",
"type":"HOLIDAY",
"placement":"ANNUAL",
"fixedDate":null,
"annualMonth":1,
"annualDay":1,
"relativeType":null,
"relativeDayOfWeek":0,
"relativeMonth":0,
"timeChangeStartHour":0,
"timeChangeStartMin":0,
"timeChangeStopHour":0,
"timeChangeStopMin":0
}
}
|
- 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.
- 412 Precondition Failed—Calendar was not locked first
- 422 Unprocessable Entity—Field Validation Error
[+]Show
{
"message": "Validation Failed",
"errors": [
{
"code" : "1000",
"field" : "type",
"message": "Invalid type. Must be HOLIDAY or TIME_CHANGE"
},
{
"code" : "1001",
"field" : "placement",
"message": "Invalid placement. Must be ANNUAL, FIXED or RELATIVE"
}
]
}
Repeated for each field:
- 1002—fixedDate—fixedDate must be specified with type of FIXED
- 1003—annualMonth—Invalid value. Must be between 1 and 12
- 1004—annualDay—Invalid value. Must be between 1 and 31.
- 1005—relativeType—Invalid value, must be EVERY, FIRST, SECOND, THIRD, FOURTH, or LAST
- 1006—relativeDayOfWeek—Invalid value. Must be between 1 and 7
- 1007—relativeMonth—Invalid value. Must be between 1 and 12
- 1008—timeChangeStartHour—Invalid value. Must be between 0 and 23
- 1009—timeChangeStartMin—Invalid value. Must be between 0 and 59
- 1010—timeChangeStopHour—Invalid value. Must be between 0 and 23
- 1011—timeChangeStopMin—Invalid value. Must be between 0 and 59
|
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
/grs/v1/tenant/{tenantId}/package/{packageId}/calendar/{calendarId}
|
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.
|