1. Home
  2. User Guides
  3. RESTful API Documentation
  4. [v2] Set Branch Operating Hour API

[v2] Set Branch Operating Hour API

Description [New Version] Calling this endpoint by providing token of admin user to set branch operating hour for a company.
Endpoint {DataManagerAPI}/api/v2/Site/[branchId]/SetBranchOperatingHours
Method POST
Headers
  1. AToken: Token value return from API 'GenerateAccessToken' by providing the user name & password
Endpoint Description
  1. 'branchId' is unique key for identifying branch, do not simply modify this value
    1. 'branchId' can be retrieve / refer from 'Sites API'
Body - JSON Example
[
            {
                "StartTime": "2022-05-19T00:00:00",
                "EndTime": "2022-05-19T01:00:00",
                "Day": 0,
                "IsDayOff": false
            },
            {
                "StartTime": "2022-05-19T01:00:00",
                "EndTime": "2022-05-19T11:00:00",
                "Day": 1,
                "IsDayOff": false
            },
            {
                "StartTime": "2022-05-19T11:00:00",
                "EndTime": "2022-05-19T23:10:00",
                "Day": 1,
                "IsDayOff": false
            },            
            {
                "StartTime": "2022-05-19T00:00:00",
                "EndTime": "2022-05-19T23:30:00",
                "Day": 2,
                "IsDayOff": false
            },
            {
                "StartTime": "2022-05-19T00:00:00",
                "EndTime": "2022-05-19T23:10:00",
                "Day": 3,
                "IsDayOff": false
            },
            {
                "StartTime": "2022-05-19T00:00:00",
                "EndTime": "2022-05-19T23:10:00",
                "Day": 4,
                "IsDayOff": false
            },
            {
                "StartTime": "2022-05-19T00:00:00",
                "EndTime": "2022-05-19T23:10:00",
                "Day": 5,
                "IsDayOff": false
            },
            {
                "StartTime": "2022-05-19T00:00:00",
                "EndTime": "2022-05-19T23:10:00",
                "Day": 6,
                "IsDayOff": false
            }
]
    
Body Description
  1. BranchOperatingHour
    1. Pass all operating hour under the branch that need to be inserted. 
    2. 'StartTime' and 'EndTime' is starting and ending time of branch operating time period
      1. The date portion in these 2 fields are not important, only time portion will be used
    3.  'Day':
      1. 0 = Sunday, 1 = Monday, 2 = Tuesday, etc
    4. 'IsDayOff' indicate whether that branch does not operate on specific day of week
  2. Full Operating Hour of the respective operating hour can be retrieve from API 'GetOperatingHours'
Response - JSON Example
{
    "Status": 200,
    "Error": "",
    "Message": "Operating Hours updated",
    "Data": null
}
Updated on October 29, 2024