Timetable
This page talks about Timetable Admin in Avaya Experience Platform™.
Overview
At the center of a timetable API design there's the entity - timetable - that represents all business hours of a Contact Center account.
Timetables
A timetable consists of:
- 
A list of day intervals
- A set of days of the week and business hours interval for these days
 - For example, one days interval - Monday, Tuesday, Wednesday, 8:00-18:00
 - STAFFED by default
 
 - 
A list of date intervals
- A set of specific dates and business hours interval
 - For example, 2021-01-01, 2021-01-02, 2021-01-03, 8:00-13:00
 - STAFFED by default
 
 - 
A list of holidays
- A specific date-time interval, during which the contact center does not work
 - UNSTAFFED by default
 
 
The priority of these entities, from high to low, is holidays > dates intervals > days intervals.
For example, we have a default working week:
- A days interval:
- days - Monday, Tuesday, Wednesday, Thursday, Friday, time - 8:00-13:00
 - days - Monday, Tuesday, Wednesday, Thursday, Friday, time - 14:00-20:00
 
 - Holidays: November 4-5
 - Dates interval: dates - 2021-11-03, time - 8:00-15:00
 
As a result:
- November 4-5 are holidays (non-working days).
 - November 3 is a shortened working day from 8:00 to 15:00 before the holiday.
 - The others are ordinary weekdays with business hours from 8:00 to 20:00 with the lunch break from 13:00 to 14:00.
 
Timetable Resource
A Timetable is composed of:
timetableId- The unique 36 character internal id that represents the timetable.
 
name- The name of the timetable. Timetable names are not unique.
 
description- The description of the timetable.
 
timeZone- The time zone of the timetable. Formatted as an IANA TZ Database Format name, e.g. 'Europe/Zurich'.
 
autoDaylightSavingTime- When 
trueauto daylight saving time will be enabled. Default value isfalse. 
- When 
 
Creating a Timetable
To create a timetable, you must provide a name, description, and a timeZone in IANA TZ Database Format. Optionally, autoDaylightSavingTime can be enabled, false by default.
POST /timetables
{
  "name": "Timetable 2021",
  "description": "A timetable for 2021 that contains a five-day working week without interruptions",
  "timeZone": "Europe/Dublin",
  "autoDaylightSavingTime": true
}
After creation, you will receive a timetableId, which you should then use to refer to the timetable from that point on.
HTTP 201 Created
{
  "timetableId": "8c872648-2b50-11ec-8d3d-0242ac130003",
  "name": "Timetable 2021",
  "description": "A timetable for 2021 that contains a five-day working week without interruptions",
  "timeZone": "Europe/Dublin",
  "autoDaylightSavingTime": true
}
Retrieving a Timetable
To retrieve a timetable, you simply need to provide the timetableId.
GET /timetables/{timetableId}
/timetables/8c872648-2b50-11ec-8d3d-0242ac130003
HTTP 200 OK
{
  "timetableId": "8c872648-2b50-11ec-8d3d-0242ac130003",
  "name": "Timetable 2021",
  "description": "A timetable for 2021 that contains a five-day working week without interruptions",
  "timeZone": "Europe/Dublin",
  "autoDaylightSavingTime": true
}
Listing Timetables
Multiple timetables for an account can be retrieved using the List Timetables API which is paginated.
GET /timetables
/timetables?pageSize=10&pageNumber=2
HTTP 200 OK
{
  "pagination": {
    "pageNumber": 2,
    "pageSize": 10,
    "total": 11
  },
  "timetables": [
    {
      "timetableId": "8c872648-2b50-11ec-8d3d-0242ac130003",
      "name": "Timetable 2021",
      "description": "A timetable for 2021 that contains a five-day working week without interruptions",
      "timeZone": "Europe/Dublin",
      "autoDaylightSavingTime": true
    }
  ],
  "links": {
    "prev": "https://uk.api.avayacloud.com/api/admin/timetable/v1/accounts/JDBUTC/timetables?pageNumber=2&pageSize=10",
    "next": ""
  }
}
Holidays
Holidays are non-working days that can be configured for the timetables.
A Holiday is composed of:
holidayId- The unique 36 character internal id that represents the holiday.
 
name- The name of the holiday. Holiday names are not unique.
 
description- The description of the holiday.
 
dates- List of specific dates the holiday applies to.
 
Creating a Holiday
To create a holiday, you must provide a name, and the list of dates in YYYY-MM-DD format that the holiday spans. Optionally, a description can be provided.
As holidays exist within timetables you'll also need the parent timetableId in the path.
POST /timetables/{timetableId}/holidays
{
  "name": "Christmas Holidays",
  "description": "Christmas holidays",
  "dates": [
    "2021-12-24",
    "2021-12-25",
    "2021-12-26"
  ]
}
After creation, you will receive a holidayId, which you should then use to refer to the holiday from that point on.
HTTP 201 Created
{
  "holidayId": "72f456b0-2b50-11ec-8d3d-0242ac130003",
  "name": "Christmas Holidays",
  "description": "Christmas holidays",
  "dates": [
    "2021-12-24",
    "2021-12-25",
    "2021-12-26"
  ]
}
Retrieving a Holiday
To retrieve a holiday, you simply need to provide the timetableId & holidayId.
GET /timetables/{timetableId}/holidays/{holidayId}
/timetables/8c872648-2b50-11ec-8d3d-0242ac130003/holidays/72f456b0-2b50-11ec-8d3d-0242ac130003
HTTP 200 OK
{
  "holidayId": "72f456b0-2b50-11ec-8d3d-0242ac130003",
  "name": "Christmas Holidays",
  "description": "Christmas holidays",
  "dates": [
    "2021-12-24",
    "2021-12-25",
    "2021-12-26"
  ]
}
Listing Holidays
Multiple holidays for a timetable can be retrieved using the List Holidays API which is paginated.
GET /timetables/{timetableId}/holidays
/timetables/8c872648-2b50-11ec-8d3d-0242ac130003/holidays?pageSize=10&pageNumber=2
HTTP 200 OK
{
  "pagination": {
    "pageNumber": 2,
    "pageSize": 10,
    "total": 12
  },
  "holidays": [
    {
      "holidayId": "72f456b0-2b50-11ec-8d3d-0242ac130003",
      "name": "Christmas Holidays",
      "description": "Christmas holidays",
      "dates": [
        "2021-12-24",
        "2021-12-25",
        "2021-12-26"
      ]
    },
    {
      "holidayId": "fef7047e-2b72-11ec-8d3d-0242ac130003",
      "name": "Saint Patrick's Day",
      "description": "Saint Patrick's Day",
      "dates": [
        "2022-03-17",
        "2022-03-17",
        "2023-03-17"
      ]
    }
  ],
  "links": {
    "prev": "https://uk.api.avayacloud.com/api/admin/timetable/v1/accounts/JDBUTC/timetables/8c872648-2b50-11ec-8d3d-0242ac130003/holidays?pageNumber=2&pageSize=10",
    "next": ""
  }
}
Intervals
Intervals are some days in timetable that are different from regular working days, e.g., reduced opening hours during the New Year holidays.
An Interval is composed of:
intervalId- The unique 36 character internal id that represents the interval.
 
name- The name of the interval. Interval names are not unique.
 
description- The description of the interval.
 
timeFrom- The start time of the interval in 24-hour format = ' HH:mm:ss' i.e. 08:00:00.
 
timeTo- The end time of the interval in 24-hour format = 'HH:mm:ss' i.e. 17:00:00.
 
typeDAYSorDATES.
appliesTo- List of specific dates (when type is 
DATES) or days (when type isDAYS) for which the time interval will be applied.- When type is 
DATESthen list must contain dates in the format 'yyyy-MM-dd' containing no more than 366 days. - When type is 
DAYSthe list must contain days of the week in the format 'dddd', it has to be no more than 7 days. 
 - When type is 
 
- List of specific dates (when type is 
 
Creating an Interval
To create an interval, you must provide a name, description, timeFrom in HH:mm:ss format, timeTo in HH:mm:ss format, type, a list of appliesTo dates in YYYY-MM-dd format.
As intervals exist within timetables you'll also need the parent timetableId in the path.
POST /timetables/{timetableId}/intervals
{
  "name": "New Year's support",
  "description": "Reduced opening hours during the New Year holidays.",
  "timeFrom": "10:00:00",
  "timeTo": "15:00:00",
  "type": "DATES",
  "appliesTo": [
    "2021-01-03",
    "2021-01-04",
    "2021-01-05",
    "2021-01-06"
  ]
}
After creation, you will receive a intervalId, which you should then use to refer to the interval from that point on.
HTTP 201 Created
{
  "intervalId": "b2fb1032-2b50-11ec-8d3d-0242ac130003",
  "name": "New Year's support",
  "description": "Reduced opening hours during the New Year holidays.",
  "timeFrom": "10:00:00",
  "timeTo": "15:00:00",
  "type": "DATES",
  "appliesTo": [
    "2021-01-03",
    "2021-01-04",
    "2021-01-05",
    "2021-01-06"
  ]
}
Retrieving an Interval
To retrieve an interval, you simply need to provide the intervalId.
GET /{timetableId}/intervals/{intervalId}
/timetables/8c872648-2b50-11ec-8d3d-0242ac130003/intervals/b2fb1032-2b50-11ec-8d3d-0242ac130003
HTTP 200 OK
{
  "intervalId": "b2fb1032-2b50-11ec-8d3d-0242ac130003",
  "name": "New Year's support",
  "description": "Reduced opening hours during the New Year holidays.",
  "timeFrom": "10:00:00",
  "timeTo": "15:00:00",
  "type": "DATES",
  "appliesTo": [
    "2021-01-03",
    "2021-01-04",
    "2021-01-05",
    "2021-01-06"
  ]
}
Listing Intervals
Multiple intervals for a timetable can be retrieved using the List Intervals API which is paginated. There are several optional filters that can be applied, refer to the API reference for more details.
GET /timetables/{timetableId}/intervals
/timetables/8c872648-2b50-11ec-8d3d-0242ac130003/intervals?pageSize=10&pageNumber=12&intervalType=DAYS
HTTP 200 OK
{
  "pagination": {
    "pageNumber": 2,
    "pageSize": 10,
    "total": 11
  },
  "intervals": [
    {
      "intervalId": "b2fb1032-2b50-11ec-8d3d-0242ac130003",
      "name": "New Year's support",
      "description": "Reduced opening hours during the New Year holidays.",
      "timeFrom": "10:00:00",
      "timeTo": "15:00:00",
      "type": "DATES",
      "appliesTo": [
        "2021-01-03",
        "2021-01-04",
        "2021-01-05",
        "2021-01-06"
      ]
    }
  ],
  "links": {
    "prev": "https://uk.api.avayacloud.com/api/admin/timetable/v1/accounts/JDBUTC/timetables/8c872648-2b50-11ec-8d3d-0242ac130003/intervals?pageNumber=2&pageSize=10",
    "next": ""
  }
}
Updated about 1 year ago