Opening Hours

Available lang-locales: de (Germany) and en (North America)

The Opening Hours service extension enables the user to retrieve information about a business's or a branch's working hours for a given date and time. It provides flexibility in querying opening hours based on a calendar configuration. Additionally, you can specify hours for specific departments to obtain more precise information for the caller.

Service Configuration

  • success : Confirms valid retrieval of opening hours.

  • fail: Signals unsuccessful retrieval of opening hours.

Dialog Usage

Add the service to your dialog as usual. A sample input set is shown below:

When creating opening hours configurations inside a JavaScript block, make sure to use JSON.stringify(<yourObject>) before you pass it into the Service!

The simple method of calendar configuration. Separate each day or date with a newline. Reasons for being open/closed can be added in round brackets in the end of each day/date. Does not support configuration of departments. An example of the object inside the Service field config is given below:

Montag: 8:00 - 16:00 
Dienstag: 10:00 - 20:00 
Mittwoch: 8:00 - 18:00 
Donnerstag: 8:00 - 18:00
Freitag: 8:00 - 18:00
Samstag: 10:00 - 16:00 
Sonntag: 
24.12.2022: - (Weihnachten)

Result Examples

Basic request with text config field and no department:

config
Montag: 8:00 - 16:00 
Dienstag: 10:00 - 20:00 
Mittwoch: 8:00 - 18:00 
Donnerstag: 8:00 - 18:00 
Freitag: 8:00 - 18:00 
Samstag: 10:00 - 16:00 
Sonntag: 
24.12.2022: - (Weihnachten)
dateTime
2022-12-26T11:59:00.000+02:00

Output: Everything is stored outside the object result

"choice": "success",
"output": {
    "result": {},
    "openNow": "true",
    "closedReason": "",
    "nextDate": "2022-12-26",
    "nextHoursStart": "08:00",
    "nextHoursEnd": "16:00"
}
Sample CURL Requests for Postman

For configJSON:

curl --location 'https://parloaservices.azurewebsites.net/api/OpeningHours?clientId=<CLIENTID>' \
--header 'x-functions-key: <your-auth-code>' \
--header 'Content-Type: application/json' \
--data '{
    "input": {
        "config": "[{\n   \"Date\": \"Montag, Dienstag, Mittwoch, Donnerstag, Freitag\",\n   \"Department\": \"Vertrieb\",\n   \"Start\": \"8\",\n   \"End\": \"20\",\n   \"Reason\": null\n}]",
        "dateTime": "2023-12-23T10:59:00.000+01:00",
        "department": "Vertrieb"
    }
}'

For config:

curl --location 'https://parloaservices.azurewebsites.net/api/OpeningHours?clientId=<CLIENTID>' \
--header 'Content-Type: application/json' \
--header 'x-functions-key: <your-auth-code>' \
--data '{
    "input": {
        "config": "Montag: 8:00 - 16:00\nDienstag: 10:00 - 20:00 \nMittwoch: 8:00 - 18:00\nDonnerstag: 8:00 - 18:00\nFreitag: 8:00 - 18:00\nSamstag: 10:00 - 16:00 \nSonntag:\n24.12.2022: - (Weihnachten)\n12-24-2023: - (Weihnachten)",
        "dateTime": "2023-12-24T10:00:36.853+01:00",
        "department": "Kundenbetreuung",
        "locale": "de"
    }
}'

Output Usage

The following example shows a way which can be used to retrieve the result data from the output. In the case of a successful response, the output is stored in 6 separate variables inside the service output. We don't need to use any other block to control the variables of our output.

The following image shows how the result can be used from the service variable openNow ,assigned to storage variable VertriebOpenNowto control a Condition Block. In this case we have two branches which decide the flow of the dialog in depending on the result.

Last updated