Add a Business Hour

Add a business hour.

Request URL

POST {base_url}/{api_path}/businesshour/create?access_token={access_token}

Request parameters

Parameter Required Type Description
timezone_id No Integer The ID of the associated time zone.
Note: You can query time zone ID using the Query Time Zone List list.
months No String The months during which the business hour applies.
Note:
  • This parameter takes effect only when the advanced time condition is enabled (time_condition_switch is 1).
  • Separate multiple months by spaces.

Valid value:

  • all: Every month.
  • jan: January.
  • feb: February.
  • mar: March.
  • apr: April.
  • may: May.
  • jun: June.
  • jul: July.
  • aug: August.
  • sep: September.
  • oct: October.
  • nov: November.
  • dec: December.
days_of_week No String The days of the week on which the business hour applies.
Note:
  • Required when time_condition_switch is 0.
  • Separate multiple values by spaces.

Valid value:

  • all: Every day.
  • sun: Sunday.
  • mon: Monday.
  • tue: Tuesday.
  • wed: Wednesday.
  • thu: Thursday.
  • fri: Friday.
  • sat: Saturday.
days No String The days of the month on which the business hour applies.
Note: This parameter takes effect only when the advanced time condition is enabled (time_condition_switch is 1).

Valid value:

  • all: Every day.
  • 1 - 31
office_times No Array<Time_Periods> The list of office time periods.
Note: At least one time period must be specified.
reset_times No Array<Time_Periods> The list of break time periods.
Note: At least one time period must be specified.
time_condition_switch No Integer Whether to enable the advanced time condition.

Valid value:

  • 0: Disabled.
  • 1: Enabled.
    Note: If enabled, the months and days parameters take effect.
remark No String The remark for the business hour.
Time_Periods
Parameter Type Description
value String The time period in the format HH:MM-HH:MM.
Note: The end time must be later than the start time.

Response parameters

Parameter Type Description
errcode Integer Returned error code.
  • 0: Succeed.
  • Non-zero value: Failed.
Note: You can check the error code and error message in Error Code and Error Message.
errmsg String Returned message.
  • SUCCESS: Succeed.
  • FAILURE: Failed.
id Integer The ID of the created business hour.

Example

Request example

POST /openapi/v1.0/businesshour/create?access_token=gwakjgu9ZBUfz36wql4ndsVKkryI0kdj HTTP/1.1

Host: yeastardocs.example.yeastarcloud.com
Content-Type: application/json
{
  "days_of_week": "mon tue wed thu fri",
  "office_times": [
    {
      "value": "09:00-18:00"
    }
  ],
  "reset_times": [
    {
      "value": "12:00-13:00"
    }
  ],
  "time_condition_switch": 0
}

Response example

HTTP/1.1 200 OK
{
  "errcode": 0,
  "errmsg": "SUCCESS",
  "submsg": "",
  "id": 1
}