Time Intervals (/interval/)
You can test API methods on the interactive API browser page and without writing code
Some of the resources described on the page may not be available by default due to the type of application (see Creating and authorizing applications).
This resource is used to manage time intervals that can be used later, for example, to specify the validity period of incoming call rules.
Description of data structures
Interval (IntervalItem)
Name | Type | Mandatory | Default value | Description |
---|---|---|---|---|
conditions | Array[condition] | yes | List of interval time range conditions | |
name | string | yes | Interval name | |
timezone | string | yes | Time zone of the interval |
Condition (Condition)Â
The parameters must be set in pairs (if "start_time" is set, then there must also be "end_time"), except for the "month" parameter, which can be set by itself.
If "start_datetime" and "end_datetime" are set, the other parameters will be ignored. All parameters (except "start_datetime" and "end_datetime") complement each other. If, for example, "month=7, start_dow=2, end_dow=3" are defined, then this implies all Mondays and Tuesdays in July.
Parameters with the "start" prefix must be smaller than parameters with the "end" prefix. The exception is the pair "start_dow/end_dow", where the entry "start_dow=3, end_dow=1" can specify all days of the week, except Monday.
At the first match by the condition, the interval is worked out, at the absence of matches in the conditions of the interval, the interval does not work.
Name | Type | Mandatory | Default value | Description |
---|---|---|---|---|
end_dow | long | none | 0 | End day of the week 1-7 (1-Sunday, 7-Saturday) |
end_mday | long | none | 0 | End day of the month (1-31) |
end_time | string | none | Â | End time in the format " hh:mm:ss" |
month | long | none | 0 | Month of validity in the range of 1-12 |
sched_active_days | long | none | 0 | Number of working days (minimum 1) starting from the start date (sched_start_date) Used for an interval of the scheduled_days type |
sched_skip_days | long | none | 0 | The number of non-working days (at least 1) to skip before the next working days (sched_active_days). Used for an interval of the scheduled_days type |
sched_start_date | string | none | Work start date in the format "YYYY-MM-DD hh:mm:ss", for example: "2015-02-20 15:33:01" Used for an interval of the scheduled_days type | |
start_datetime | string | none | Start date in the format "YYYY-MM-DD hh:mm:ss", for example: "2015-02-20 15:33:01" Used for an interval of the datetime_range type. | |
end_datetime | string | none | End date in the format "YYYY-MM-DD hh:mm:ss", for example: "2015-02-20 16:34:00" Used for an interval of the datetime_range type. | |
start_dow | long | none | 0 | Start day of week 1-7 (1-Sunday, 7-Saturday) |
start_mday | long | none | 0 | Start day of the month (1-31) |
start_time | string | none | Â | Start time in the format "hh:mm:ss" |
type | string | none | response parameter. May be one of the:Â datetime_range interval scheduled_days | |
usage | object | none | null | {
'task_scheduler': {}, # {task_sched_id: null}
'context_rule': {}, # {ext_id: [{context: 1, option: ‘start’, rule: 2}], }
'incom_rule': {} # {ext_id: [{rule: 1}], }
} Contains information on the use of intervals in Task Schedulers, inbound call rules, and IVR context rules. Relevant only for client-level and extension intervals. |
Example
For a client with ID 12, create a range that is responsible for Monday-Friday from 09:00 to 18:00 and Saturday from 09:00 to 14:00:
Resources of the "Client" section
Resources of the "Internal number" section
Â