Edit a Business Hour

Update the configuration of a business hour.

Request URL

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

Request parameters

Parameter Required Type Description
id Yes Integer The unique ID of the business hour.
Note: You can query the business hour ID using the Query Business Hour List interface.
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:
  • This parameter takes effect only 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.
reset_times No Array<Time_Periods> The list of break time periods.
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.

Example

Request example

POST /openapi/v1.0/businesshour/update?access_token=Y7Vg2HxvPjdeiSPuj7qmyyG9d4QHfewi HTTP/1.1

Host: yeastardocs.example.yeastarcloud.com
Content-Type: application/json
{
  "id": 2,
  "remark": "shanghai"
}

Response example

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