Business Hours

Resource Fields

Name Type Read-only Description
title string
zones Zones
holidays Holidays
is_default boolean
created_at timestamp ISO-8601 Format
updated_at timestamp ISO-8601 Format

Zones

RESOURCE FIELDS

Name Type Read-only Description
monday array
tuesday array
wednesday array
thursday array
friday array
saturday array
sunday array

Metadata




 
 




Actions

Retrieve all business hours

GET /api/v1/businesshours.json

Information

Allowed for Admins & Owners
Scope configuration
Ordered by id (ascending)

Response

    {
        "status": 200,
        "data": [
            {
    "id": 1,

    "title": "US office hours",
    "zones": {
        "monday": [9, 10, 11, 12, 13, 14, 15, 16, 17, 18],
        "tuesday": [9, 10, 11, 12, 13, 14, 15, 16, 17, 18],
        "wednesday": [9, 10, 11, 12, 13, 14, 15, 16, 17, 18],
        "thursday": [9, 10, 11, 12, 13, 14, 15, 16, 17, 18],
        "friday": [9, 10, 11, 12, 13, 14, 15, 16, 17, 18],
        "saturday": [],
        "sunday": []
    },
    "holidays": [],
    "is_default": true,
    "created_at": "2015-07-21T07:10:42+05:00",
    "updated_at": "2015-07-21T07:10:42+05:00",

    "resource_type": "business_hour"

    ,"resource_url": "https://brewfictus.kayako.com/api/v1/businesshours/1"

}

        ],
        "resource": "business_hour",
        "offset": 0,
        "limit": 10,
        "total_count": 1
    }

Retrieve a business hour

GET /api/v1/businesshours/:id.json

Information

Allowed for Admins & Owners
Scope configuration

Response

    {
        "status": 200,
        "data": {
    "id": 1,

    "title": "US office hours",
    "zones": {
        "monday": [9, 10, 11, 12, 13, 14, 15, 16, 17, 18],
        "tuesday": [9, 10, 11, 12, 13, 14, 15, 16, 17, 18],
        "wednesday": [9, 10, 11, 12, 13, 14, 15, 16, 17, 18],
        "thursday": [9, 10, 11, 12, 13, 14, 15, 16, 17, 18],
        "friday": [9, 10, 11, 12, 13, 14, 15, 16, 17, 18],
        "saturday": [],
        "sunday": []
    },
    "holidays": [],
    "is_default": true,
    "created_at": "2015-07-21T07:10:42+05:00",
    "updated_at": "2015-07-21T07:10:42+05:00",

    "resource_type": "business_hour"

    ,"resource_url": "https://brewfictus.kayako.com/api/v1/businesshours/1"

}
,
        "resource": "business_hour"
    }

Add a business hour

POST /api/v1/businesshours.json

Information

Allowed for Admins & Owners
Scope configuration

Parameters

Name Type Mandatory Description
title string
zones string
JSON encoded object of open hours with keys as day and values as array of open hours. At least one open hour must be specified.
The json array elements should have a key value pair of days and open hours array where days should be out of monday, tuesday, wednesday, thursday, friday, saturday, sunday and open hour values must be between 0 and 23.

Example:
{"monday": [9, 10, 11, 12], "tuesday": [13, 14, 15, 16], "wednesday": [17, 18, 19, 20]}
holidays array Holidays are specified as an array of holidays.

Example:
[{ "title": "Festivus", "date": "23/12/2016" , "open_hours": [1,2,0]}, { "title": "Christmas", "date": "25/12/2016" }]

Response

    {
        "status": 201,
        "data": {
    "id": 1,

    "title": "US office hours",
    "zones": {
        "monday": [9, 10, 11, 12, 13, 14, 15, 16, 17, 18],
        "tuesday": [9, 10, 11, 12, 13, 14, 15, 16, 17, 18],
        "wednesday": [9, 10, 11, 12, 13, 14, 15, 16, 17, 18],
        "thursday": [9, 10, 11, 12, 13, 14, 15, 16, 17, 18],
        "friday": [9, 10, 11, 12, 13, 14, 15, 16, 17, 18],
        "saturday": [],
        "sunday": []
    },
    "holidays": [],
    "is_default": true,
    "created_at": "2015-07-21T07:10:42+05:00",
    "updated_at": "2015-07-21T07:10:42+05:00",

    "resource_type": "business_hour"

    ,"resource_url": "https://brewfictus.kayako.com/api/v1/businesshours/1"

}
,
        "resource": "business_hour"
    }

Update a business hour

PUT /api/v1/businesshours/:id.json

Information

Allowed for Admins & Owners
Scope configuration

Parameters

Name Type Mandatory Description
title string
zones string Existing zones are replaced with the given ones. So make sure you specify all zones you want to get updated.
The json object elements should have a key value pair of days and open hours array where days should be out of monday, tuesday, wednesday, thursday, friday, saturday, sunday and open hour values must be between 0 and 23.

Example:
{"monday": [9, 10, 11, 12], "tuesday": [13, 14, 15, 16], "wednesday": [17, 18, 19, 20]}
holidays array Holidays are specified as an array of holidays.

Example:
[{ "title": "Festivus", "date": "23/12/2016" , "open_hours": [1,2,0]}, { "title": "Christmas", "date": "25/12/2016" }]
is_default boolean

Response

    {
        "status": 200,
        "data": {
    "id": 1,

    "title": "US office hours",
    "zones": {
        "monday": [9, 10, 11, 12, 13, 14, 15, 16, 17, 18],
        "tuesday": [9, 10, 11, 12, 13, 14, 15, 16, 17, 18],
        "wednesday": [9, 10, 11, 12, 13, 14, 15, 16, 17, 18],
        "thursday": [9, 10, 11, 12, 13, 14, 15, 16, 17, 18],
        "friday": [9, 10, 11, 12, 13, 14, 15, 16, 17, 18],
        "saturday": [],
        "sunday": []
    },
    "holidays": [],
    "is_default": true,
    "created_at": "2015-07-21T07:10:42+05:00",
    "updated_at": "2015-07-21T07:10:42+05:00",

    "resource_type": "business_hour"

    ,"resource_url": "https://brewfictus.kayako.com/api/v1/businesshours/1"

}
,
        "resource": "business_hour"
    }

Delete a business hour

DELETE /api/v1/businesshours/:id.json

Information

Allowed for Admins & Owners
Scope configuration

Response

{
    "status": 200
}

Delete business hours

DELETE /api/v1/businesshours.json

Information

Allowed for Admins & Owners
Scope configuration

Arguments

Name Type Mandatory Description
ids string
The comma separated ids

Response

{
    "status": 200,
    "total_count": 2
}