Skip to main content

外呼任务

零、注意事项:

0.1 格式说明

所有API,若未特殊注明,Content-Type 全部使用 application/json

0.2 出参约定格式

如无特殊说明,出参固定为以下格式:

参数类型说明
codeint状态码,0 - 成功, 其余为失败
messagestring提示信息
datamixed数据

data 具体格式见每个接口具体说明

0.3 域名

如果无特殊说明,以下 API 中,所有域名均为: https://autocall.icsoc.net

一、外呼-任务创建/更新

建议您直接在后台管理系统中创建及更新外呼任务,以便获得更好的操作体验。

1.1 路由

POST/PUT /api/v3/projects/updateOrCreate

1.2 入参

参数类型说明必填默认值
idint项目id,当更新时必填
dept_idint部门ID0
typeint项目类型1-预测式外呼,3-自动外呼,4-机器人外呼
namestring项目名称
statusint状态:0-关闭,1-开启,2-暂停0
priorityint任务的权重,数字越大,呼叫时的比例就越大,0~255100
concurrentint并发线路
callersarray任务的主叫号码
max_conn_secsint最长通话时长300
timeout_secsint外呼超时时间,从超过此时间未接通则挂断30
max_queue_secsint数据时效性,数据从收到后需要在此时长内发起呼叫,如果超过此时间,则不呼叫,0为不限0
enable_asrbool是否开通ASR识别false
configconfig配置
recall_strategiesrecallStrategies重呼策略
assigned_usersassignedUsers[]分配的坐席详情(type为1时必填,type=4 并且 config.enable_scheduler=true 时必填)
worktimeworktime外呼时间段详情 参照 1.2.3
filter_rulesfilterRules数据过滤规则
contextstring预测式外呼(即,type=1) 传入固定值:mc_transque; 自动外呼(即,type=3) 传入固定值:mc_transivr; 机器人外呼(即,type=4) 传入固定值:mc_transai
trans_tointstring当 mc_transque 时,为技能组ID;当mc_transivr时,为ivr code;当mc_transai时,为机器人的话术id

1.2.1 recallStrategies

key 值定义:1-用户忙、2-无法接通、3-关机、4-停机、5-空号、11-呼叫限制

参数类型说明必填默认值
defaultobject默认重呼策略(enable_asr=false)
recallint默认策略状态 0-关闭 1-开启
recall_max_timesint默认策略重呼次数
recall_intervalarray默认策略重呼间隔分钟数
recall_strategies.asrobjectasr 重呼策略(enable_asr=true) key 值定义:1-用户忙、2-无法接通、3-关机、4-停机、5-空号、11-呼叫限制
{
"default": {
"recall": 1,
"recall_interval_type": 0,
"recall_max_times": 1,
"recall_interval": [
12
]
},
"asr": {
"1": {
"recall": 0,
"recall_interval_type": 0,
"recall_interval": 60,
"recall_max_times": [
5
]
},
"2": {
"recall": 0,
"recall_interval_type": 0,
"recall_interval": 60,
"recall_max_times": [
5
]
},
"11": {
"recall": 0,
"recall_interval_type": 0,
"recall_interval": 60,
"recall_max_times": [
5
]
}
}
}

1.2.2 assignedUsers

参数类型说明必填默认值
user_idint分配的坐席Id (坐席工号和坐席Id 二选一,注意:当type=4并且config.enable_scheduler=true 时,当前坐席信息必须归属于 config.que_id 的技能组下)
user_numstring分配的坐席工号 (坐席工号和坐席Id 二选一)
conn_limitint坐席接通上限0
[
{
"user_id": 100000,
"conn_limit": 200
},
{
"user_num": "1001",
"conn_limit": 0
}
]

1.2.3 worktime

参数类型说明必填默认值
workingobject具体的工作时间(0 ~ 6 代表 周日至周六)
namestring工作时间别名
{
"working": {
"1": [
[
"09:00:00",
"10:00:00"
],
[
"12:00:00",
"16:00:00"
]
],
"2": [
[
"09:00:00",
"10:00:00"
],
[
"12:00:00",
"16:00:00"
]
],
"3": [
[
"09:00:00",
"10:00:00"
],
[
"12:00:00",
"16:00:00"
]
],
"4": [
[
"09:00:00",
"10:00:00"
],
[
"12:00:00",
"16:00:00"
]
],
"5": [
[
"09:00:00",
"10:00:00"
],
[
"12:00:00",
"16:00:00"
]
],
"6": [
[
"09:00:00",
"10:00:00"
],
[
"12:00:00",
"16:00:00"
]
],
"0": [
[
"09:00:00",
"10:00:00"
],
[
"12:00:00",
"16:00:00"
]
]
}
}

1.2.4 config

参数类型说明必填默认值
webhookwebhookwebhook 设置
makecall_flagint是否开启全程录音:0-否;8-全程录音
call_ratio_typeint预测式外呼呼叫系数(type=1时必填):0-自动调整; 1-手动指定
manual_call_ratiofloat预测式外呼手动指定方式下的外呼呼叫系数(call_ratio_type=1时必填)
max_call_ratiofloat最大的呼叫系数(type为1或4时必填)
init_call_ratiofloat初始呼叫系数1
ttstts机器人外呼场景下的 tts 配置(type=4时必填)
nlp_silence_timeint机器人外呼场景下语音断句检测时长(type=4时必填)
enable_schedulerbool机器人外呼场景下智能调度开关(type=4时必填)
agent_wait_timeint机器人外呼场景下智能调度坐席等待时长,单位秒(type=4时必填) 说明:座席等待时长为配置让座席等待配置的时长后再进线,例如配置为30s,则座席空闲30秒后再将来电分配给他,这个30s为至少的时长,有可能实际等待时长会超过此时长
que_idint机器人外呼场景下智能调度转人工技能组ID(type=4时必填)
{
"makecall_flag": 8,
"call_ratio_type": 0,
"manual_call_ratio": 10,
"max_call_ratio": 8,
"enable_scheduler": true,
"agent_wait_time": 0,
"que_id": 10123,
"tts": {
"provider": "ali",
"name": "xiaoyun",
"voice": "xiaoyun",
"pitch": 0,
"speed": 0,
"volume": 50,
"options": {}
},
"nlp_silence_time": 500,
"webhook": {
"enable": true,
"ids": [23, 24]
}
}
1.2.4.1 webhook 格式
参数类型说明必填默认值
enableboolwebhook 是否开启
idsint[]配置的 webhook 主键ID
1.2.4.2 tts 格式
参数类型说明必填默认值
providerstringali-阿里;tx-腾讯
namestring腾讯音色阿里音色
voicestring音色,同 name 值
speedint语速,见各文档
pitchint语调,见各文档
volumeint音量,见各文档
{
"provider": "ali",
"name": "xiaoyun",
"voice": "xiaoyun",
"pitch": 0,
"speed": 0,
"volume": 50,
}

{
"name": "10510000",
"voice": "10510000",
"pitch": 0,
"speed": 0,
"volume": 0,
"provider": "tx"
},

1.2.5 filterRules

参数类型说明必填默认值
historybool导入任务历史数据过滤
blacklistbool导入任务黑名单数据过滤
call_blacklistbool呼叫时黑名单数据过滤
crm_protected_clientbool呼叫时crm受保护客户数据过滤
{
"history": false,
"blacklist": false,
"call_blacklist": false,
"crm_protected_client": false
}

1.3 出参

参数类型说明
idint项目id
mamestring项目名称
typeint任务类型:1-预测式外呼,3-自动外呼,4-机器人外呼
type_stringstring任务类型名称
statusint状态:1-开启,2-暂停
created_atstring创建时间
updated_atstring更新时间

1.4 举例

1.4.1 入参

{
"name": "yansongda",
"type": 1,
"concurrent": 10,
"status": 1,
"priority": 10,
"callers": [
"02136093491",
"02136093495"
],
"timeout_secs": 110,
"max_conn_secs": 200,
"max_queue_secs": 10,
"enable_asr": 1,
"config": {
"call_ratio_type": 0,
"max_call_ratio": 8,
"manual_call_ratio": null,
"makecall_flag": 8
},
"recall_strategies": {
"asr": {
"1": {
"recall": 1,
"recall_interval_type": 0,
"recall_interval": 2,
"recall_max_times": [
0
]
},
"2": {
"recall": 1,
"recall_interval_type": 0,
"recall_interval": 1,
"recall_max_times": [
0
]
},
"3": {
"recall": 1,
"recall_interval_type": 0,
"recall_interval": 2,
"recall_max_times": [
0
]
},
"4": {
"recall": 1,
"recall_interval_type": 0,
"recall_interval": 1,
"recall_max_times": [
0
]
},
"5": {
"recall": 1,
"recall_interval_type": 0,
"recall_interval": 1,
"recall_max_times": [
0
]
},
"11": {
"recall": 1,
"recall_interval_type": 0,
"recall_interval": 1,
"recall_max_times": [
0
]
}
}
},
"worktime": {
"working": {
"1": [
[
"17:01:00",
"17:02:00"
],
[
"18:01:00",
"18:03:00"
]
]
}
},
"assigned_users": [
{
"user_id": 11,
"conn_limit": 13
},
{
"user_id": 12,
"conn_limit": 14
}
]
}

1.4.2 出参

{
"code": 0,
"message": "success",
"request_id": "3xNIhChsN9IA4DAtL1tjkj2twswhyatu",
"data": {
"id": 10000
}
}

二、外呼-任务删除

2.1 路由

DELETE/POST /api/v3/projects/delete

2.2 入参

参数类型说明必填
idsint[]项目id
is_forcebool是否强制删除 0-否 1-是 默认0

2.3 出参

2.4 举例

{
"code": 0,
"message": "success",
"request_id": "3xNIhChsN9IA4DAtL1tjkj2twswhyatu"
}

三、外呼-任务列表

3.1 路由

GET /api/v3/projects/lists

3.2 入参

参数类型说明必填
typeint项目类型1-预测式外呼,3-自动外呼,4-机器人外呼
current_pageint当前页
per_pageint每页数据量
statusint状态:0-关闭,1-开启
namestring项目名称,模糊搜索

3.3 出参

参数类型说明
current_pageint当前页码
total_pageint总页数
per_pageint每页条数
totalint总条数
emptyboll是否空
resultsProject[]项目列表

3.3.1 Project 定义

参数类型说明
idint项目id
namestring项目名称
typeint任务类型:1-预测式外呼,3-自动外呼,4-机器人外呼
type_stringstring任务类型名称
dept_namestring部门名称
statusint状态:1-开启,2-暂停
status_stringstring任务呼叫状态
waiting_countint待呼叫条数
recall_waiting_countint待重呼数
recall_pending_countint未到重呼时间的重呼数
calling_countint呼叫中数
created_atstring创建时间
updated_atstring更新时间
updated_user_namestring更新人

3.4 举例

3.4.1 入参

{
"current_page": 1,
"per_page": 10,
"name": "项目1",
"status": 1
}

3.4.2 出参

{
"code": 0,
"message": "操作成功",
"request_id": "6dc089b0179c4f57761ba2060ffd1871",
"data": {
"current_page": 1,
"totalPage": 1,
"per_page": 20,
"total": 10,
"empty": false,
"results": [
{
"id": 10015,
"name": "test",
"type": 1,
"concurrent": 22,
"status": 1,
"priority": 22,
"context": "mc_transque",
"exten": "ivr_in",
"trans_to": "266",
"callers": [
"01212345671",
"01212345674"
],
"timeout_secs": 30,
"max_conn_secs": 600,
"enable_asr": false,
"config": {
"call_ratio_type": 0,
"max_call_ratio": 8,
"manual_call_ratio": null,
"makecall_flag": 8
},
"recall_strategies": {
"asr": {
"1": {
"recall": 1,
"recall_interval_type": 0,
"recall_interval": 2,
"recall_max_times": [
0
]
},
"2": {
"recall": 1,
"recall_interval_type": 0,
"recall_interval": 1,
"recall_max_times": [
0
]
},
"3": {
"recall": 1,
"recall_interval_type": 0,
"recall_interval": 2,
"recall_max_times": [
0
]
},
"4": {
"recall": 1,
"recall_interval_type": 0,
"recall_interval": 1,
"recall_max_times": [
0
]
},
"5": {
"recall": 1,
"recall_interval_type": 0,
"recall_interval": 1,
"recall_max_times": [
0
]
},
"11": {
"recall": 1,
"recall_interval_type": 0,
"recall_interval": 1,
"recall_max_times": [
0
]
}
}
},
"worktime": {
"working": {
"1": [
[
"17:01:00",
"17:02:00"
],
[
"18:01:00",
"18:03:00"
]
]
}
},
"created_at": "2021-03-22 07:30:02",
"created_user_name": "1 | 开发环境",
"updated_at": "2021-03-22 16:27:14",
"updated_user_name": "yansongda | yansongda",
"un_called": 0,
"total_called": 0,
"status_string": "启用",
"type_string": "预测式外呼",
"call_ratio_type_string": "自动调整",
"call_type_string": "正常"
}
]
}
}

四、外呼-任务详情

POST /api/v3/projects/detail

4.1 入参

参数类型说明必填
idint项目id

4.2 出参

参数类型说明
idint项目id,当更新时必填
namestring项目名称
typeint任务类型:1-预测式外呼,3-自动外呼,4-机器人外呼
type_stringstring任务类型
statusint状态:1-开启,2-暂停
status_stringstring状态
priorityint任务的权重,数字越大,呼叫时的比例就越大,0~255
concurrentint并发线路
callersarray任务的主叫号码
max_conn_secsint最长通话时长
timeout_secsint外呼超时时间,从超过此时间未接通则挂断
enable_asrbool是否开通ASR识别
recall_strategiesobject重呼策略 参照 任务新建 1.2
worktimeobject外呼时间段详情 参照 任务新建 1.2
configobject呼叫配置信息 参照 任务新建 1.2
assigned_usersarray坐席用户列表 参照 任务新建 1.2

4.3 举例

4.3.1 出参

{
"code": 0,
"message": "操作成功",
"request_id": "6dc089b0179c4f57761ba2060ffd1871",
"data": {
"id": 10015,
"name": "test",
"type": 1,
"concurrent": 22,
"status": 1,
"priority": 22,
"context": "mc_transque",
"exten": "ivr_in",
"trans_to": "266",
"callers": [
"01212345671",
"01212345674"
],
"timeout_secs": 30,
"max_conn_secs": 600,
"enable_asr": false,
"config": {
"call_ratio_type": 0,
"max_call_ratio": 8,
"manual_call_ratio": null,
"makecall_flag": 0
},
"recall_strategies": {
"asr": {
"1": {
"recall": 1,
"recall_interval": [
1
],
"recall_interval_type": 0,
"recall_max_times": 1
},
"2": {
"recall": 1,
"recall_interval": [
2
],
"recall_interval_type": 0,
"recall_max_times": 1
},
"3": {
"recall": 1,
"recall_interval": [
1
],
"recall_max_times": 2
},
"4": {
"recall": 1,
"recall_interval": [
3
],
"recall_interval_type": 0,
"recall_max_times": 1
},
"5": {
"recall": 1,
"recall_interval": [
1
],
"recall_interval_type": 0,
"recall_max_times": 2
},
"11": {
"recall": 1,
"recall_interval": [
1
],
"recall_interval_type": 0,
"recall_max_times": 1
}
}
},
"worktime": {
"working": {
"1": [
[
"17:01:00",
"17:02:00"
],
[
"18:01:00",
"18:03:00"
]
]
}
},
"created_at": "2021-03-22 07:30:02",
"created_user_name": "1 | 开发环境",
"updated_at": "2021-03-22 16:27:14",
"updated_user_name": "yansongda | yansongda",
"un_called": 0,
"total_called": 0,
"status_string": "启用",
"type_string": "预测式外呼",
"call_ratio_type_string": "自动调整",
"call_type_string": "正常"
}
}

五、外呼-启动/禁用任务

POST /api/v3/projects/status/update

5.1 入参

参数类型说明必填
idint项目id
statusint状态:1-开启,2-暂停

5.2 出参

六、外呼-所有任务

6.1 路由

GET /api/v3/projects/all

6.2 入参

参数类型说明必填
typeint项目类型1-预测式外呼,3-自动外呼,4-机器人外呼

6.3 出参

参数类型说明
codeint状态码,0 - 成功, 其余为失败
messageint提示信息
dataarray项目数据,见 detail 接口

6.4 举例

6.4.1 出参

{
"code": 0,
"message": "success",
"request_id": "MTBlk4aU4TfnBpdERgKjlOipN2jQKq9R",
"data": [
{
"id": 2,
"name": "test",
"type": 1,
"concurrent": 10,
"status": 1,
"priority": 10,
"context": "mc_transag",
"exten": "ivr_in",
"trans_to": 1,
"transId": 0,
"callers": [
"01212345670"
],
"timeout_secs": 110,
"max_conn_secs": 200,
"maxQueueSecs": 10,
"enable_asr": false,
"ttsOptions": null,
"call_ratio_type": 1,
"manual_call_ratio": 1,
"max_call_ratio": 8,
"created_at": "2021-02-25 09:32:06",
"created_user_name": "yansongda | yansongda",
"updated_at": "2021-03-01 02:53:45",
"updated_user_name": "5470 | yansongda",
"status_string": "启用",
"type_string": "预测试外呼",
"call_ratio_type_string": "手动调整",
"un_called": 2,
"totalCall": 1
}
]
}