Appearance
任务列表
接口信息
- 接口:
/agent-api/new/user/{user_id}/task - 请求方式:
GET
路由参数
| 参数 | 类型 | 示例 | 解释 | 必填 |
|---|---|---|---|---|
| user_id | string | 5832d184-dd53-42a0-8ace-0bf8d660f4cc | 用户 id(主账号) | 是 |
请求参数
| 参数 | 类型 | 示例 | 解释 | 必填 |
|---|---|---|---|---|
| page | int | 1 | 页码 | 否 |
| per_page | int | 15 | 每页个数 | 否 |
| name | string | 任务 | 任务名称 | 否 |
| status | int|array | 1 | 任务状态 (1:任务暂停 3:执行中&等待执行) | 否 |
| sub_user_id | string | ca58-49af-be34-8370d | 子账户 id(传递此参数则是对子账户操作) | 否 |
| task_type | int | 6 | 6: 2.0 任务 7: 新 2.0 任务 | 否 |
请求示例
cURL
curl -X GET "https://ai.api.longlonglong.cn/agent-api/new/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/task?page=1&per_page=15" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"Go
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
url := "https://ai.api.longlonglong.cn/agent-api/new/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/task?page=1&per_page=15"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}JavaScript
const axios = require('axios');
axios.get('https://ai.api.longlonglong.cn/agent-api/new/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/task', {
params: {
page: 1,
per_page: 15
},
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Error:', error);
});Java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String url = "https://ai.api.longlonglong.cn/agent-api/new/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/task?page=1&per_page=15";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Content-Type", "application/json")
.header("Authorization", "Bearer YOUR_TOKEN")
.GET()
.build();
HttpClient client = HttpClient.newHttpClient();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}PHP
<?php
$url = 'https://ai.api.longlonglong.cn/agent-api/new/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/task?page=1&per_page=15';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'Authorization: Bearer YOUR_TOKEN'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;Python
import requests
url = 'https://ai.api.longlonglong.cn/agent-api/new/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/task'
params = {
'page': 1,
'per_page': 15
}
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
}
response = requests.get(url, params=params, headers=headers)
print(response.json())C++
#include <iostream>
#include <string>
#include <curl/curl.h>
size_t WriteCallback(void* contents, size_t size, size_t nmemb, void* userp) {
((std::string*)userp)->append((char*)contents, size * nmemb);
return size * nmemb;
}
int main() {
CURL* curl;
CURLcode res;
std::string readBuffer;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://ai.api.longlonglong.cn/agent-api/new/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/task?page=1&per_page=15");
struct curl_slist* headers = NULL;
headers = curl_slist_append(headers, "Content-Type: application/json");
headers = curl_slist_append(headers, "Authorization: Bearer YOUR_TOKEN");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);
res = curl_easy_perform(curl);
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
std::cout << readBuffer << std::endl;
}
return 0;
}注意事项
为了方便2.0外呼任务,可使用旧时间组 (dial_time_id),进行创建或更新2.0任务操作,但时间组中工作时间的更新,目前并未与使用其的2.0任务同步。
任务状态根据
enable和远程任务(new_task_extra)中的call_status判断任务状态。enable call_status 任务状态 true true 任务拨打中 false false 任务暂停中 true false 任务暂停中 远程任务字段
new_task_extra值为空,则为异常任务,请删除重新创建**
返回示例
json
{
"code": 200,
"status": "success",
"message": "返回任务列表信息成功",
"meta": {
"has_pages": true,
"total": 31,
"last_page": 31,
"current_page": 1,
"per_page": "1"
},
"data": [
{
"uuid": "e5cb8746-411d-4d6d-a1fa-0fe030f00fad", // 任务id
"name": "测试api接口创建-222", // 任务名称
"create_datetime": "2024-12-04 11:17:34",// 创建时间
"alter_datetime": "2024-12-04 11:17:37",
"start": 0, // 废弃
"enable": false, // 任务状态
"maximumcall": 1,
"call_per_second": 10, // 废弃
"recycle_limit": 0,
"random_assignment_number": 0,
"disable_dial_timegroup": null,
"dial_time_id": 5,
"destination_extension": "102",
"group_type": "group",
"destination_dialplan": "XML",
"destination_context": "default",
"scheduling_policy_ratio": null,
"scheduling_queue": null,
"dial_format": "",
"domain": null,
"remark": null,
"sort": 33,
"originate_variables": "{execute_on_media=start_da}",
"_originate_timeout": 60,
"_origination_caller_id_number": "20000",
"user_id": "b6d94bef-5ac2-4c6e-ba13-d2f8f124862b",
"auto_recycle_rule_id": null,
"clue_configuration_id": null,
"deleted_at": null,
"call_notify_type": 2,
"call_pause_second": 0,
"call_notify_fail_stop": 0,
"bridge_group_id": null,
"is_test": false,
"is_top": 0,
"empty_seat_stop": 0,
"background_file_id": null,
"background_file_name": null,
"end_action": null,
"task_type": 6,
"line_callee": "",
"cache_number_count": 0,
"mode_id": null,
"bridge_maximumcall": 0,
"bridge_proportion": 0,
"direct_bridge": 0,
"direct_bridge_echo": 0,
"llm_intention_id": 0,
"score_scheme_id": 0,
"restart_at": null,
"enable_type": 0,
"background_id": null, // 背景音id
"background": "",
"is_group_switch": 0, // AI对话模型-是否按时间配置
"task_extras": { // 本地任务
"line": ["xxxx"], // 线路id (新2.0为[{"id": "XXXX","limit": 2}]格式)
"stop_time": "2025-11-01 13:25:26",
"work_hour": [ // 工作时间
{
"end": "19:00",
"wday": 1,
"begin": "03:00"
},
{
"end": "23:30",
"wday": 1,
"begin": "20:00"
},
{
"end": "19:00",
"wday": 2,
"begin": "03:00"
},
{
"end": "19:00",
"wday": 3,
"begin": "03:00"
},
{
"end": "23:30",
"wday": 3,
"begin": "20:00"
},
{
"end": "19:00",
"wday": 4,
"begin": "03:00"
},
{
"end": "23:30",
"wday": 4,
"begin": "20:00"
},
{
"end": "19:00",
"wday": 5,
"begin": "03:00"
},
{
"end": "19:00",
"wday": 6,
"begin": "03:00"
},
{
"end": "19:00",
"wday": 0,
"begin": "03:00"
}
],
"work_week": [ //工作周
1,
2,
3,
4,
5,
6,
0
],
"start_time": "2024-11-01 13:25:26" //任务开始时间
},
"status_str": "停止",
"task_cause": [ // 任务暂停原因(新2.0)
"任务结束时间不能早于当前时间",
"任务结束时间不符合"
],
"call_status": true, // 任务状态(新2.0)
"new_task_extra": { // 远程任务
"id": "XXXXX",
"name": "测试api接口创建-222",
"enable": 0,
"line": ["xxxx"], // 线路id (新2.0为[{"id": "XXXX","limit": 2}]格式)
"limit": 1,
"cps": 1,
"start_time": "2024-11-01 13:25:26",
"stop_time": "2025-11-01 13:25:26",
"work_week": [
1,
2,
3,
4,
5,
6,
0
],
"work_hour": [
{
"wday": 1,
"begin": "20:00",
"end": "23:30"
},
{
"wday": 3,
"begin": "20:00",
"end": "23:30"
},
{
"wday": 4,
"begin": "20:00",
"end": "23:30"
}
],
"destination_extension": "102", // AI对话模型ID
"destination_extension_list": [ // AI对话模型-按时间配置(新2.0)
{
"begin": "09:00",
"end": "12:00",
"destination_extension": "XXXXX"
}
],
"redial_enabled":false, // 重呼配置(新2.0)
"redial_new_number_policy": false, // 首次外呼优先(新2.0)
"redial_interval": 3, // 重呼间隔(新2.0)
"redial_max_times": 3, // 重呼次数(新2.0)
"redial_conditions": [ // 重呼条件(新2.0)
"hangup_cause": null,
"da_status": [ // 详情见列表
"failed",
"not convenient",
"redial later",
"is not reachable",
"cannot be connected",
"not answer",
"power off",
"hold on",
"busy now",
"call reminder",
"barring of incoming",
"not in service",
"not a local number",
"forwarded",
"line is busy",
"number change",
"line fault",
"bus_close",
"busy"
]
],
"blacklist": "",
"background": "",
"call_status": false,
"number_count": 0,
"call_info": { // 当前任务线路拨打情况
"90611087-c2c2-4f04-8fe3-c8e33e5d1ffa": {
"task_id": "cd355395-566d-4894-a2cb-b8900dca9dc5", // 任务id
"task_name": "测试任务",
"node_id": "2533f3f6-7ac1-4b55-b1de-7d308ce00d89", // 线路对应节点id
"line_id": "90611087-c2c2-4f04-8fe3-c8e33e5d1ffa", // 线路id
"line_name": "测试站ip对接线路", // 线路名称
"cps": 10,
"limit": 10, // 并发数
"call_status": 1,
"dialed_number_total": 2, // 拨打了多少个号码
"answer_total": 1, // 总共接通多少号码
"gateway_error_hangup_total": 0,
"normal_hangup_total": 2, //总挂断
"bill": 8000,
"calling_count": 0,
"answering_count": 0
}
}
},
"caller_line": null,
"auto_recycle_rule": null,
"group": {
"id": 102,
"name": "测试模型",
"default": false
},
"llm_intention_config": null,
"status": 1
}
]
}字段说明
| 参数 | 类型 | 解释 |
|---|---|---|
| uuid | string | 任务id |
| name | string | 任务名称 |
| create_datetime | datetime | 创建日期 |
| alter_datetime | datetime | 修改日期 |
| start | int | 任务启动标识(已废弃) |
| enable | bool | 任务状态 |
| maximumcall | int | 最大并发呼叫 |
| call_per_second | int | CPS 每秒最大发起多少个呼叫 |
| recycle_limit | int | 号码最大回收次数(废弃) |
| random_assignment_number | int | 是否随机分配号码(废弃) |
| disable_dial_timegroup | string | 禁止呼叫时间组id |
| dial_time_id | int | 呼叫时间id |
| destination_extension | int | 话术组id |
| group_type | string | 话术组类型 1.0话术:group 2.0话术:robot |
| destination_dialplan | string | 应答转接拨号方案 |
| destination_context | string | 应答后转接上下文 |
| scheduling_policy_ratio | double | 外呼比率(废弃) |
| scheduling_queue | string | 调度队列(废弃) |
| dial_format | string | 拨号串格式 |
| domain | string | 租户域名(废弃) |
| remark | string | 任务别名(备注) |
| sort | int | 排序 |
| originate_variables | string | 自定义外呼参数 |
| originatetimeout | int | 拨号超时 |
| originationcaller_id_number | string | 主叫号码 |
| user_id | string | 用户id |
| caller_line_id | string | 线路id |
| auto_recycle_rule_id | string | 重呼规则id |
| clue_configuration_id | string | 线索配置id |
| deleted_at | datetime | 删除时间 |
| call_notify_url | string | 挂断通知 |
| call_notify_type | bool | 通知类型 0不通知 1呼叫失败通知 2呼叫失败和成功都通知 |
| call_pause_second | int | 呼叫间隔 |
| call_stop_notify_url | string | 任务停止通知地址 |
| call_notify_fail_stop | bool | 任务停止标识 |
| bridge_group_id | int | 转接组id |
| is_test | int | 测试任务标识 |
| is_top | int | 置顶 |
| empty_seat_stop | bool | 坐席为空停止标识 |
| background_file_id | string | 转接背景音id |
| background_file_name | string | 转接背景音名称 |
| end_action | int | 任务结束动作 0-无操作 1-暂停任务释放并发 2-暂停任务锁定并发 |
| task_type | int | 任务类型 |
| line_callee | string | 线路呼入号码 |
| cache_number_count | int | 缓存号码数量 |
| mode_id | int | 数字人交互样式 |
| bridge_maximumcall | int | 转接最大并发数 |
| bridge_proportion | int | 并发比例 |
| direct_bridge | int | 转接 |
| direct_bridge_echo | int | 转接全忙进入话术标识 |
| llm_intention_id | int | 大模型意向标签配置id |
| restart_at | datetime | 重启时间 |
| enable_type | int | 2.0启用类型标识 0外呼 1大模型外呼 |
| background_id | int | 背景音id |
| background | string | 背景音地址 |
| is_group_switch | int | 自动切换模型标识 |
| is_call_in | int | 呼入标识 |
| status_str | string | 任务状态转译 |
| task_cause | array | 任务暂停原因(新2.0) |
| call_status | bool | 任务状态(新2.0) |
| caller_line | json | 关联线路信息 |
| auto_recycle_rule | json | 关联重呼规则信息 (新2.0在new_task_extra.redial_enabled) |
| group | json | 关联话术组信息 |
| llm_intention_config | json | 关联大模型意向配置信息 |
| status | int | 状态 |
| task_extras | json | 任务额外信息 |
| new_task_extra | json | 任务额外信息(2.0) |
| new_task_extra.line | array | 线路信息 2.0结构 ["XXXXX"] 新2.0结构 [{"id": "XXXX","limit": 2}] |
| new_task_extra.destination_extension | string | AI对话模型 |
| new_task_extra.destination_extension_list | array | AI对话模型-按时间配置(新2.0)[{"begin": "09:00","end":"12:00","destination_extension": "215870475195883520"}] |
| new_task_extra.redial_enabled | bool | 重呼配置(新2.0) |
| new_task_extra.redial_new_number_policy | bool | 首次外呼优先(新2.0) |
| new_task_extra.redial_interval | int | 重呼间隔 最多60分钟 |
| new_task_extra.redial_max_times | int | 重呼次数 最多3次 |
| new_task_extra.da_status | string | 重呼状态(新2.0) failed:运营商拦截、not convenient|redial later:拒接、is not reachable|cannot be connected|not answer:无应答、does not exist:空号、power off:关机、out of service:停机、hold on|busy now|call reminder:占线|用户正忙、barring of incoming:呼入限制、defaulting:欠费、not in service|not a local number|forwarded|line is busy|number change|line fault|bus_close|busy:呼损 |
| new_task_extra.pop_mode | int | 弹出模式(新2.0):0=随机 1=顺序 2=倒序 |