添加呼入路由
添加并配置呼入路由。
请求 URL
POST {base_url}/{api_path}/inbound_route/create?access_token={access_token}
请求参数
| 参数 | 是否必填 | 类型 | 说明 |
|---|---|---|---|
| name | 是 | String | 呼入路由名称。 |
| alert_info | 否 | String | 呼入路由特色响铃。 |
| did_option | 否 | String | DID 号码匹配模式。 取值范围:
|
| did_pattern_list | 否 | Array<DID_Pattern_List> | DID 号码匹配规则列表。 注: 此参数在
did_option 为 patterns
时必填。 |
| did_pattern_to_ext | 否 | String | 匹配到分机的 DID 号码匹配规则。 注: 此参数在
did_option 为
pattern_to_ext 时必填。 |
| did_to_ext_start | 否 | String | 匹配到分机范围的 DID 号码匹配规则起始号码。 注: 此参数在
did_option 为 range_to_ext
时必填。 |
| did_to_ext_end | 否 | String | 匹配到分机范围的 DID 号码匹配规则结束号码。 注: 此参数在
did_option 为 range_to_ext
时必填。 |
| did_pattern_to_ext_list | 否 | Array<DID_Pattern_Ext_List> | DID 号码和对应分机列表。 注: 此参数在
did_option 为
pattern_to_ext_list 时必填。 |
| cid_option | 否 | String | 主叫号码匹配规则。 取值范围:
|
| cid_pattern_list | 否 | Array<CID_Pattern_List> | 主叫号码匹配规则列表。 注: 此参数在
cid_option 为 patterns
时必填。 |
| cid_to_phonebook | 否 | Array<Integer> | 来电匹配的企业联系人群组的唯一 ID。 注:
|
| trunk_list | 是 | Array<Trunk_List> | 呼入路由中选择的中继列表。 |
| def_dest | 是 | String | 呼入路由的默认目的地。
|
| def_dest_prefix | 否 | String |
此参数的设置取决于
|
| def_dest_value | 否 | String | 此参数的设置取决于 def_dest 的设置值。
|
| def_dest_ext_list | 否 | Array<Ext_List> | 选择的分机或分机组列表。 注: 此参数在
def_dest 为
pattern_to_ext 时必填。 |
| ringback_tone | 否 | String | 自定义提示音的文件名 (如
demo.wav)。在分机用户接听来电之前,系统会向呼叫者播放该提示音。注:
|
| enb_time_condition | 否 | Integer | 是否启用时间条件。 取值范围:
注: 当设置为
1
时,timezone_id 和
time_condition 必填。 |
| timezone_id | 否 | Integer | 时区 ID。 注: 可通过 查询时区列表 接口查询时区 ID。
|
| time_condition | 否 | String | 时间类型。 取值范围:
|
| time_condition_value | 否 | Array<Custom_Time> | 自定义办公时间或时间段。 |
| business_hours_destination | 否 | String |
办公时间内外线来电的目的地。 取值范围:
|
| business_hours_destination_value | 否 | String | 办公时间外线来电的详细目的地。
|
| outside_business_hours_destination | 否 | String |
非办公时间外线来电的目的地类型。 取值范围:
|
| outside_business_hours_destination_value | 否 | String | 非办公时间外线来电的具体目的地。
|
| holidays_hours_destination | 否 | String |
假期期间外线来电的目的地类型。 取值范围:
|
| holidays_hours_destination_value | 否 | String | 假期期间收到的外线来电的具体目的地。
|
| enb_holiday_dest_ignore | 否 | Integer | 是否将假期期间的外线来电按照办公时间目的地进行路由。 取值范围:
注:
ignore_holiday_dest
和 enb_play_holiday_prompt_global
不能同时启用。 |
| enb_play_holiday_prompt_global | 否 | Integer | 是否在将假期期间的外线来电路由至假期目的地之前播放假期提示音。 取值范围:
注:
ignore_holiday_dest
和 enb_play_holiday_prompt_global
不能同时启用。 |
- DID_Pattern_List
-
参数 是否必填 类型 说明 did_pattern 是 String DID 匹配规则。
- DID_Pattern_Ext_List
-
参数 是否必填 类型 说明 did_pattern 是 String DID 号码。 did_pattern_to_ext 是 String DID 号码对应分机的 ID。 注: 可使用 搜索特定分机 接口查询需要的分机 ID。
- CID_Pattern_List
-
参数 是否必填 类型 说明 cid_pattern 是 String 主叫号码匹配规则。 - Trunk_List
-
参数 是否必填 类型 说明 id 是 Integer 中继的唯一 ID。 注: 可使用 搜索特定中继 接口查询中继 ID。name 否 String 中继名称。 type 否 String 中继类型。 - Ext_List
-
参数 是否必填 类型 说明 value 是 String 分机/分机组的唯一 ID。 name 否 String 分机/分机组名称。 number 否 String 分机号码。 type 否 String 所选项目的类型。 取值范围:
extension:分机ext_group:分机组
- Custom_Time
-
参数 是否必填 类型 说明 days_of_week 否 Integer 时间段适用的星期。 取值范围:
sun:星期日mon:星期一tue:星期二wed:星期三thu:星期四fri:星期五sat:星期六
注: 多个值用空格分隔。times 否 Array<String> 时间段的时间范围。 months 否 String 时间段适用的月份。 取值范围:
jan:一月feb:二月mar:三月apr:四月may:五月jun:六月jul:七月aug:八月sep:九月oct:十月nov:十一月dec:十二月
注: 多个值用空格分隔。days 否 String 时间段适用的日期。 取值范围:1 - 31
注: 多个值用空格分隔。dest 否 String 时间段内收到的外线来电的目的地前缀。
取值范围:
end_call:挂断extension:分机ext_vm:分机语音信箱group_vm:群语音信箱outroute:呼出路由ai_receptionist:AI 接待员ring_group:响铃组queue:队列conference:会议室ivr:IVRcall_flow:通话流程external_num:外部号码play_greeting:播放问候语后挂断
dest_prefix 否 String 时间段内收到的外线来电的目的地前缀。 注: 仅当time_conditioni设置为custom或route_scope,且dest设置为external_num或play_greeting时,配置此参数。- 如果
dest为external_num,此参数定义外部号码的呼出前缀。 - 如果
dest为play_greeting,此参数定义提示音的播放次数,支持1-5范围内的整数。
dest_value 否 String 时间段内收到的外线来电的详细目的地。 - 如果
dest为play_greeting,此参数定义自定义提示音的文件名 (如demo.wav)。可使用 获取菜单选项 接口查询自定义提示音的文件名 (
"menu":"custom_prompt")。 - 如果
dest为extension、ext_vm、group_vm、ivr、call_flow、ring_group、conference、ai_receptionist、outroute或queue,此参数定义目的地的 ID。例如,目的地是分机 2002,则此参数应设置为分机的 ID
2。 - 如果
dest为external_num,此参数定义外部号码。
time_condition_switch 否 Integer 是否启用高级时间设置,以支持按星期、月份和日期的组合方式配置时间条件。 取值范围:
0:禁用。1:启用。
响应参数
| 参数 | 类型 | 说明 |
|---|---|---|
| errcode | Integer | 返回错误码。
注: 更多错误码和错误信息说明,请参见 错误码 & 错误信息。
|
| errmsg | String | 返回信息。
|
| id | Integer | 呼入路由的唯一 ID。 |
示例
请求示例
POST /openapi/v1.0/inbound_route/create?access_token=Rka0iV0BJUVTXj1EYpwbg2YUkODdw22N HTTP/1.1 Host: yeastardocs.example.yeastarcloud.com Content-Type: application/json { "name": "demo", "trunk_list": [ { "id": 14 } ], "def_dest":"end_call", "enb_time_condition": 1, "time_condition": "route_scope", "timezone_id": 1, "business_hours_destination": "extension", "business_hours_destination_value": "1000-Leo Ball", "outside_business_hours_destination": "group_vm", "outside_business_hours_destination_value": "6100-6100", "holidays_hours_destination": "ivr", "holidays_hours_destination_value": "6200-测试", "time_condition_value": [ { "days_of_week": "mon tue wed thu fri", "times": [ "08:45-11:45", "13:15-18:00" ], "months": "jan feb mar", "days": "1 2 3", "dest": "end_call", "dest_prefix": "", "dest_value": "", "time_condition_switch": 1 }, { "days_of_week": "mon tue wed thu fri", "times": [ "11:45-13:15" ], "months": "", "days": "", "dest": "", "dest_prefix": "", "dest_value": "", "time_condition_switch": 0 } ] }
响应示例
HTTP/1.1 200 OK { "errcode": 0, "errmsg": "SUCCESS", "id": 15 }