This page was last edited on July 20, 2020, at 15:43.
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 office hours. It lets you handle the following use cases.
To configure office hours, create and configure an Office Hours service using the Service Management UI, as detailed in the Help.
Be 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 list of correct timezones.
A complete list of options is available in the [office-hours] section of the Genesys Mobile Services Options Reference guide.
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.
> 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"
}
]
}