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:
Valid value:
|
| days_of_week | No | String | The days of the week on which the business hour applies. Note:
Valid value:
|
| 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:
|
| 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:
|
| 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.
Note: You can check the error code and
error message in Error Code and Error Message.
|
| errmsg | String | Returned message.
|
| 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
}