This page was last edited on January 4, 2018, at 09:54.
Comments or questions about this documentation? Contact us for support!
The Calendar Service API queries for all office hours so that your mobile app can make an intelligent first offer to the user based on what's available in the next couple days, or with an explanatory hint such as "Our offices are open from 8:00 am to 5:00 pm, please enter the desired time.".
The calendar service API is intended to be tight to your business hours. It lets you handle the following use cases.
Make sure to update the existing calendar configuration to set the correct timezone for your business-hours service. For instance, if you configured "EST", or "PST" timezones with the Genesys Administrator Extension, your parameters must use the timezones defined for Java such as "America/Toronto", or "Europe/Paris". See Wikipedia to get the list of correct timezones.
[service.business-hours]
_bh_add1=07-14 12:00-14:30
_bh_regular1=Mon-Fri 01:00-23:00
_service=office-hours
_timezone=Europe/Paris
_ttl=30
_type=builtin
The Calendar Service REST query retrieves the office hours per day for a provided period.
GET /genesys/1/service/{service-execution-name} | |||
---|---|---|---|
Parameter | Type | Mandatory | Description |
Body | |||
start | Date | no | Start date is specified in "ISO 8601" format, using UTC as timezone: "YYYY-MM-ddTHH:mm:ssZ". If not specified then it is assumed to be now. |
number-of-days | integer | no | Specifies how many days ahead to include into interval beginning form the "start" time. Used as an alternative to the end date. If neither "end", nor "number-of-days" is specified, then end date is assumed to be the same as start date. |
end | Date | no | End date is specified in "ISO 8601" format, using UTC as timezone: "YYYY-MM-ddTHH:mm:ssZ". If neither "end", nor "number-of-days" is specified, then end date is assumed to be the same as start date. |
Request example: GET http://127.0.0.1:8080/genesys/1/service/business-hours?start=2014-12-03T15:00:00.000Z&number-of-days=2
The Calendar service returns an array of periods ordered in ascending chronological order. If the array is empty then there are no calendar events for the specified duration. If an error occurs while processing the request then the error is specified in the "error" data field, the contents of periods array, in that case, are undefined.
> GET /genesys/1/service/business-hours?start=2016-10-05T15:00:00.000Z&number-of-days=2 HTTP/1.1
> Host: 127.0.0.1:8080
> User-Agent: curl/7.50.3
> Accept: */*
>
< HTTP/1.1 200 OK
< Set-Cookie: JSESSIONID=1wftsntzmfydfybt0v75gbprp;Path=/genesys;HttpOnly
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< Content-Type: application/json;charset=UTF-8
< Transfer-Encoding: chunked
<
{
"error": null,
"open_for": "11:20",
"periods": [
{
"start": "2016-10-05T15:00:00.000Z",
"end": "2016-10-05T21:00:00.000Z"
},
{
"start": "2016-10-05T23:00:00.000Z",
"end": "2016-10-06T21:00:00.000Z"
},
{
"start": "2016-10-06T23:00:00.000Z",
"end": "2016-10-07T15:00:00.000Z"
}
]
}