REST API文档
高级配置-自动外呼
自动外呼
信息说明如下:
| 参数 | 说明 |
|---|---|
| id | ID |
| dest_number | 被叫号码 |
| group_id | 所属任务组ID |
| external_id | 外部 ID |
| uuid | 通话UUID |
| call_status | 呼叫状态(calling呼叫中, done, stop手动停止) |
| outbound_call | 是否发起过外呼(0:发起过 1:未发起过) |
| call_start_time | 呼叫开始时间 |
| call_end_time | 呼叫结束时间 |
| cause | 挂机原因 |
| created_at | 创建时间 |
| updated_at | 更新时间 |
| deleted_at | 删除时间 |
查询自动外呼信息
- 请求 URL:
/api/out_call_tasks - 请求 URL:
/api/out_call_tasks?perPage=500&page=1&name=test&status=init
注:根据任务名称或任务状态查询(其中 name 为任务名称,status 为任务状态,page 为页数,perPage 为每页显示条数)
请求方式:
GETBody 信息:无
返回值:
{ "page": 1, "data": [{ "auto_record": "0", "description": "", "task_end_time": "", "dest_context": "", "group_confirm_file": "", "status": "init", "cid_name": "", "total": 0, "done": 0, "deleted_at": "", "group_confirm_read_timeout": "", "updated_at": "2026-04-24 05:18:23", "created_at": "2026-04-24 05:18:23", "id": "1", "action": "", "task_start_time": "", "context": "", "max_concurrency": "1", "disable_ring_back": "1", "data": "", "group_name": "test", "max_caps": "1", "auto_dial": "0", "group_confirm_key": "", "cid_number": "", "calling_time": "30" }], "rowCount": 1, "pageCount": 1 }
查看指定自动外呼表的配置参数
- 请求 URL:
/api/out_call_tasks/$id - 请求方式:
GET - Body 信息:无
- 返回值:
{ "done_total": "0/0", "id": 1, "action": "", "auto_record": 0, "task_start_time": "", "context": "", "task_end_time": "", "group_confirm_file": "", "description": "", "updated_at": "2026-04-24 05:18:23", "data": "", "created_at": "2026-04-24 05:18:23", "calling_time": 30, "max_concurrency": 1, "disable_ring_back": 1, "group_name": "test", "group_confirm_key": "", "auto_dial": 0, "max_caps": 1, "cid_name": "", "status": "init", "deleted_at": "", "cid_number": "", "dest_context": "" }
返回信息说明如下:
| 参数 | 说明 |
|---|---|
| done_total | 完成数量统计 |
| id | ID |
| action | 执行动作 |
| auto_record | 自动录音开关 |
| task_start_time | 任务开始时间 |
| context | 呼叫源 |
| task_end_time | 任务结束时间 |
| group_confirm_file | 确认文件 |
| description | 任务描述 |
| updated_at | 更新时间 |
| data | 数据 |
| created_at | 创建时间 |
| calling_time | 呼叫超时时间 |
| max_concurrency | 最大并发数 |
| disable_ring_back | 关闭回铃音 |
| group_name | 任务组名称 |
| group_confirm_key | 群组确认密钥 |
| auto_dial | 自动外呼开关 |
| max_caps | 最大并发上限 |
| cid_name | 主叫名称 |
| status | 任务状态 |
| deleted_at | 删除时间 |
| cid_number | 主叫号码 |
| dest_context | 出局呼叫源 |
创建新的自动外呼
- 请求 URL:
/api/out_call_tasks - 请求方式:
POST - Body 信息:
| 参数 | 说明 |
|---|---|
| group_name | 任务名称 |
| description | 描述 |
Body
{ "group_name": "test2", "description": "test" }
- 返回值:
{ "message": "success", "data": 3, "code": 200 }
修改指定自动外呼表
修改基本信息
- 请求 URL:
/api/out_call_tasks/$id - 请求方式:
PUT - Body 信息:
| 参数 | 说明 |
|---|---|
| group_name | 任务名称 |
| description | 描述 |
| cid_number | 主叫号码 |
| cid_name | 主叫名称 |
{ "group_name": "test1", "description": "test", "cid_number": "1000", "cid_name": "1000" }
- 返回值:
{ "code": 200, "message": "success", "data": "1" }
修改呼叫设置
- 请求 URL:
/api/out_call_tasks/$id - 请求方式:
PUT - Body 信息:
| 参数 | 说明 |
|---|---|
| dest_context | 出局呼叫源 |
| calling_time | 超时时长 |
| max_caps | CAPS |
| max_concurrency | 最大并发呼叫数 |
| task_start_time | 任务开始时间 |
| auto_dial | 定时任务开关 |
| disable_ring_back | 回铃音开关 |
| auto_record | 自动录音开关 |
{ "dest_context": "context-1", "calling_time": 30, "max_caps": 1, "max_concurrency": 1, "task_start_time": "", "auto_dial": 0, "disable_ring_back": 1, "auto_record": 0 }
- 返回值:
{ "code": 200, "message": "success", "data": "1" }
修改呼叫确认
- 请求 URL:
/api/out_call_tasks/$id - 请求方式:
PUT - Body 信息:
| 参数 | 说明 |
|---|---|
| group_confirm_key | 确认键 |
| group_confirm_read_timeout | 按键超时 |
| group_confirm_file | 确认文件 |
{ "group_confirm_key": "1", "group_confirm_read_timeout": "2", "group_confirm_file": "{\"media_id\":205,\"media_path\":\"phrase:welcome_short@xui\",\"media_type\":\"SYSTEM\",\"media_name\":\"welcome_short\"}" }
- 返回值:
{ "code": 200, "message": "success", "data": "1" }
修改接通后动作
- 请求 URL:
/api/out_call_tasks/$id - 请求方式:
PUT - Body 信息:
| 参数 | 说明 |
|---|---|
| action | 动作 |
| data | 数据 |
| group_confirm_file | 确认文件 |
{ "action": "playback", "data": "{\"media_id\":205,\"media_path\":\"phrase:welcome_short@xui\",\"media_type\":\"SYSTEM\",\"media_name\":\"welcome_short\"}", "group_confirm_file": "{\"media_type\":\"SYSTEM\",\"media_id\":205,\"media_name\":\"welcome_short\",\"media_path\":\"phrase:welcome_short@xui\"}" }
- 返回值:
{ "code": 200, "message": "success", "data": "1" }
创建被叫号码表
- 请求 URL:
/api/out_call_tasks/$id/import - 请求方式:
POST - Body 信息:
| 参数 | 说明 |
|---|---|
| dest_number | 被叫号码 |
| external_id | 外部 ID |
{ "data": [ { "dest_number": "1000", "external_id": "" } ] }
- 返回值:
{ "data": "{}", "code": 200, "message": "success" }
查看被叫号码表
请求 URL:
/api/out_call_tasks/$id/numbers请求方式:
GETBody 信息:无
返回值:
{ "pageCount": 1, "data": [{ "outbound_call": "1", "id": "7", "dest_number": "111", "dtmf": "", "cause": "", "call_answer_time": "", "call_status": "init", "created_at": "2026-04-24 08:19:50", "external_id": "7", "group_id": "1", "updated_at": "2026-04-24 08:19:50", "call_end_time": "", "call_start_time": "", "uuid": "", "deleted_at": "" }, { "outbound_call": "1", "id": "6", "dest_number": "", "dtmf": "", "cause": "", "call_answer_time": "", "call_status": "init", "created_at": "2026-04-24 08:17:20", "external_id": "", "group_id": "1", "updated_at": "2026-04-24 08:17:20", "call_end_time": "", "call_start_time": "", "uuid": "", "deleted_at": "" }], "page": 1, "rowCount": 2 }
导出被叫号码表
请求 URL:
/api/out_call_tasks/$id/download请求方式:
GETBody 信息:无
返回值:
[ [ "任务名称", "接通后动作", "被叫号码", "呼叫状态", "呼叫开始时间", "呼叫应答时间", "呼叫结束时间", "总时长", "计费时长", "挂机原因" ], [ "test1", "放音", "1000", "init", "", "", "", "" ] ]
启动/关闭自动外呼
启动自动外呼
- 请求 URL:
api/out_call_tasks - 请求方式:
PUT - Body 信息:
{ "action": "start", "data": [ "2" ] }
- 返回值:
{ "data": [{ "task_start_time": "now()", "data_id": "2", "updated_at": "now()", "status": "running" }], "code": 200, "message": "success" }
关闭自动外呼
- 请求 URL:
api/out_call_tasks - 请求方式:
PUT - Body 信息:
{ "action": "stop", "data": [ "2" ] }
- 返回值:
{ "message": "success", "data": [{ "status": "stop", "data_id": "2", "updated_at": "now()", "task_end_time": "now()" }], "code": 200 }
克隆自动外呼
- 请求 URL:
/api/out_call_tasks/clone - 请求方式:
POST - Body 信息:
| 参数 | 说明 |
|---|---|
| group_name | 任务名称 |
| description | 描述 |
| is_clone_numbers | 是否包含所有被叫号码 |
| id | ID |
Body
{ "group_name": "test3", "description": "test", "is_clone_numbers": true, "id": 2 }
- 返回值:
{ "code": 200, "data": 4, "message": "success" }
删除指定自动外呼表
- 请求 URL:
/api/out_call_tasks/$id - 请求方式:
DELETE - Body 信息:无
- 返回值:
{ "message": "success", "data": "2", "code": 200 }