外呼任务接口

创建外呼任务

  • 请求方式:POST
  • 请求地址:/openapi/v1/callTask/create
  • 请求时请进行接口鉴权

请求参数

字段名类型必填默认值说明
nameString-任务名称
remarkString-任务备注
agentNumbersList<String>-参与座席工号数组
effectiveCallStatusInteger0是否开启有效电话,0关闭,1开启
effectiveCallTypeInteger1有效电话定义:1-所有通话,2-已接通,3-通话时长
effectiveCallTimeInteger0有效通话时长(单位:秒),仅当 effectiveCallType 为 3 时生效
openCallStatisticsInteger0是否开启号码呼叫情况统计,0否,1是

请求示例

{ "name": "2026年7月回访任务", "remark": "针对上月客户的满意度回访", "agentNumbers": ["1001", "1002", "1003"], "effectiveCallStatus": 1, "effectiveCallType": 2, "effectiveCallTime": 0, "openCallStatistics": 1}

响应参数(data)

字段名类型说明
taskIdString创建成功后的任务ID
successBoolean是否创建成功

响应示例

{ "code": 200, "message": "success", "data": { "taskId": "task_20260716_001", "success": true }}

导入外呼任务号码

  • 请求方式:POST
  • 请求地址:/openapi/v1/callTask/import
  • 请求时请进行接口鉴权

请求参数

字段名类型必填默认值说明
taskIdString-任务ID(由创建接口返回)
numbersList<Number>-导入号码列表,详见下方 Number 结构
importBatchNumberString自动生成导入批次号,用于标识本次导入
duplicateCheckTypeString"2"号码查重策略:1-账户内去重,2-当前任务内去重,3-不查重
syncCustomerBooleanfalse是否同步客户资料
existingCustomerStrategyString"skip"同步客户时客户已存在的处理策略:skip-跳过,update-更新
Number 结构:
字段名类型必填说明
nameString客户名称
phoneString电话号码
remarkString备注

请求示例

{ "taskId": "task_20260716_001", "numbers": [ { "name": "张三", "phone": "13800138001", "remark": "VIP客户" }, { "name": "李四", "phone": "13800138002" }, { "name": "王五", "phone": "13800138003", "remark": "需二次跟进" } ], "importBatchNumber": "batch_20260716_01", "duplicateCheckType": "2", "syncCustomer": true, "existingCustomerStrategy": "update"}

响应参数(data)

字段名类型说明
taskIdString任务ID
successBoolean导入是否成功
importBatchNumberString导入批次号
requestedCountInteger请求导入的号码总数
importedCountInteger实际成功导入的号码数
skippedCountInteger因查重被跳过的号码数
invalidNumbersList<String>无效号码列表
customerSyncBoolean是否开启了客户同步
customerSyncSuccessBoolean客户同步是否成功
customerInsertedCountInteger新增客户数
customerUpdatedCountInteger更新客户数
customerSkippedCountInteger跳过的客户数
customerSyncMessageString客户同步消息说明

响应示例

{ "code": 200, "message": "success", "data": { "taskId": "task_20260716_001", "success": true, "importBatchNumber": "batch_20260716_01", "requestedCount": 3, "importedCount": 2, "skippedCount": 1, "invalidNumbers": [], "customerSync": true, "customerSyncSuccess": true, "customerInsertedCount": 1, "customerUpdatedCount": 1, "customerSkippedCount": 0, "customerSyncMessage": "客户同步完成" }}

查询外呼任务执行情况

  • 请求方式:POST
  • 请求地址:/openapi/v1/callTask/query
  • 请求时请进行接口鉴权

请求参数

字段名类型必填默认值说明
taskIdString-任务ID
pageNumInteger1页码(继承自 Page)
pageSizeInteger10每页条数(继承自 Page)

请求示例

{ "taskId": "task_20260716_001", "pageNum": 1, "pageSize": 20}

响应参数(data)

字段名类型说明
taskIdString任务ID
taskNameString任务名称
statusString任务状态编码
statusDescriptionString任务状态描述
totalCountInteger号码总数
calledCountInteger已呼叫号码数
waitingCountInteger待呼叫号码数
answeredCountInteger已接通数
unansweredCountInteger未接通数
calloutCountInteger总呼叫次数
executionProgressBigDecimal执行进度(百分比)
numbersPageResult<NumberVO>号码分页列表,详见下方 NumberVO 结构
NumberVO 结构:
字段名类型说明
idString号码记录ID
nameString客户名称
phoneString电话号码
remarkString备注
importBatchNumberString所属导入批次号
callCountInteger呼叫次数
lastResultString最近一次呼叫结果编码
lastResultDescriptionString最近一次呼叫结果描述
lastCallTimeDate最近一次呼叫时间
recentlyCallAgentString最近一次呼叫座席
recentlyCallTimeString最近一次呼叫时间(格式化)

响应示例

{ "code": 200, "message": "success", "data": { "taskId": "task_20260716_001", "taskName": "2026年7月回访任务", "status": "running", "statusDescription": "执行中", "totalCount": 100, "calledCount": 60, "waitingCount": 40, "answeredCount": 45, "unansweredCount": 15, "calloutCount": 85, "executionProgress": 60.00, "numbers": { "total": 100, "pages": 5, "current": 1, "records": [ { "id": "num_001", "name": "张三", "phone": "13800138001", "remark": "VIP客户", "importBatchNumber": "batch_20260716_01", "callCount": 2, "lastResult": "answered", "lastResultDescription": "已接通", "lastCallTime": "2026-07-16T10:30:00.000+08:00", "recentlyCallAgent": "1001", "recentlyCallTime": "2026-07-16 10:30:00" } ] } }}

附录:调用流程说明

典型的使用流程如下:
  1. 创建任务 — 调用 /v1/callTask/create 创建外呼任务,获取 taskId
  1. 导入号码 — 调用 /v1/callTask/import 向任务中批量导入号码
  1. 查询进度 — 调用 /v1/callTask/query 轮询或按需查询任务执行情况及号码级别呼叫详情

注意事项

  • 所有接口均需通过 OpenAPI 鉴权
  • agentNumbers 中的座席工号需为系统内已存在的有效工号
  • 导入接口支持多次调用,可分批向同一任务导入号码
  • 查重策略 duplicateCheckType 为 "1" 时,会在整个账户范围内查重;为 "2" 时仅在当前任务内查重;为 "3" 时不做任何查重
  • effectiveCallType 为 3 时,effectiveCallTime 字段才生效,用于定义通话时长达到多少秒才算有效电话
2026-07-23