Appearance
任务修改
请求信息
- 接口:
/agent-api/new/user/{user_id}/task/{task_id} - 请求方式:
PUT
路由参数
| 参数 | 类型 | 示例 | 解释 | 必填 |
|---|---|---|---|---|
| user_id | string | 5832d184-dd53-42a0-8ace-0bf8d660f4cc | 用户id(主账号) | 是 |
| task_id | string | f232d184-dd54-42a0-8ace-0bf8d660f4cc | 任务id | 是 |
旧版任务2.0
请求示例
cURL
curl -X PUT "https://ai.api.longlonglong.cn/agent-api/new/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/task/f232d184-dd54-42a0-8ace-0bf8d660f4cc" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{
"name": "测试api接口创建-222",
"destination_extension": 102, // 话术分组id
"maximumcall": 1, // 并发总数 (线路总并发)
"dial_time_id": 5, // 呼叫时间组
"background_id": 52, // 背景音id 需要提供背景音列表等接口
"task_extras": {
"start_time": "2024-11-01 13:25:26", // 开始时间 (必填)
"stop_time": "2025-11-01 13:25:26", // 结束时间
"line": [], // line参数除外,不传线路,也需传递空数组
"holiday": [ // 假期时间 (选填)可设置多个 (不传,也需传递空数组)
{
"begin": "2024-11-01 13:25",
"end": "2024-11-03 13:25"
}
]
},
"group_switch_rule": [ // 2.0-AI对话模型-按时间配置(新版2.0AI对话模型配置在task_extras.destination_extension_list)
{
"switch_start": "09:00", // 开始时间
"switch_end": "12:00", // 结束时间
"group_id": 13037, // 时间段话术
"default_group_id": 123 // 默认配置话术
}
]
}'Go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
url := "https://ai.api.longlonglong.cn/agent-api/new/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/task/f232d184-dd54-42a0-8ace-0bf8d660f4cc"
payload := map[string]interface{}{
"name": "测试api接口创建-222",
"destination_extension": 102, // 话术分组id
"maximumcall": 1, // 并发总数 (线路总并发)
"dial_time_id": 5, // 呼叫时间组
"background_id": 52, // 背景音id 需要提供背景音列表等接口
"task_extras": map[string]interface{}{
"start_time": "2024-11-01 13:25:26", // 开始时间 (必填)
"stop_time": "2025-11-01 13:25:26", // 结束时间
"line": []interface{}{}, // line参数除外,不传线路,也需传递空数组
"holiday": []map[string]string{
{
"begin": "2024-11-01 13:25",
"end": "2024-11-03 13:25",
},
}, // 假期时间 (选填)可设置多个 (不传,也需传递空数组)
},
"group_switch_rule": []map[string]interface{}{ // 2.0-AI对话模型-按时间配置
{
"switch_start": "09:00", // 开始时间
"switch_end": "12:00", // 结束时间
"group_id": 13037, // 时间段话术
"default_group_id": 123, // 默认配置话术
},
},
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("PUT", url, bytes.NewBuffer(jsonData))
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');
const data = {
name: '测试api接口创建-222',
destination_extension: 102, // 话术分组id
maximumcall: 1, // 并发总数 (线路总并发)
dial_time_id: 5, // 呼叫时间组
background_id: 52, // 背景音id 需要提供背景音列表等接口
task_extras: {
start_time: '2024-11-01 13:25:26', // 开始时间 (必填)
stop_time: '2025-11-01 13:25:26', // 结束时间
line: [], // line参数除外,不传线路,也需传递空数组
holiday: [ // 假期时间 (选填)可设置多个 (不传,也需传递空数组)
{
begin: '2024-11-01 13:25',
end: '2024-11-03 13:25'
}
]
},
group_switch_rule: [ // 2.0-AI对话模型-按时间配置
{
switch_start: '09:00', // 开始时间
switch_end: '12:00', // 结束时间
group_id: 13037, // 时间段话术
default_group_id: 123 // 默认配置话术
}
]
};
axios.put('https://ai.api.longlonglong.cn/agent-api/new/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/task/f232d184-dd54-42a0-8ace-0bf8d660f4cc', data, {
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/f232d184-dd54-42a0-8ace-0bf8d660f4cc";
String json = """
{
"name": "测试api接口创建-222",
"destination_extension": 102, // 话术分组id
"maximumcall": 1, // 并发总数 (线路总并发)
"dial_time_id": 5, // 呼叫时间组
"background_id": 52, // 背景音id 需要提供背景音列表等接口
"task_extras": {
"start_time": "2024-11-01 13:25:26", // 开始时间 (必填)
"stop_time": "2025-11-01 13:25:26", // 结束时间
"line": [], // line参数除外,不传线路,也需传递空数组
"holiday": [ // 假期时间 (选填)可设置多个
{
"begin": "2024-11-01 13:25",
"end": "2024-11-03 13:25"
}
]
},
"group_switch_rule": [ // 2.0-AI对话模型-按时间配置
{
"switch_start": "09:00", // 开始时间
"switch_end": "12:00", // 结束时间
"group_id": 13037, // 时间段话术
"default_group_id": 123 // 默认配置话术
}
]
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Content-Type", "application/json")
.header("Authorization", "Bearer YOUR_TOKEN")
.PUT(HttpRequest.BodyPublishers.ofString(json))
.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/f232d184-dd54-42a0-8ace-0bf8d660f4cc';
$data = [
'name' => '测试api接口创建-222',
'destination_extension' => 102, // 话术分组id
'maximumcall' => 1, // 并发总数 (线路总并发)
'dial_time_id' => 5, // 呼叫时间组
'background_id' => 52, // 背景音id 需要提供背景音列表等接口
'task_extras' => [
'start_time' => '2024-11-01 13:25:26', // 开始时间 (必填)
'stop_time' => '2025-11-01 13:25:26', // 结束时间
'line' => [], // line参数除外,不传线路,也需传递空数组
'holiday' => [ // 假期时间 (选填)可设置多个
[
'begin' => '2024-11-01 13:25',
'end' => '2024-11-03 13:25'
]
]
],
'group_switch_rule' => [ // 2.0-AI对话模型-按时间配置
[
'switch_start' => '09:00', // 开始时间
'switch_end' => '12:00', // 结束时间
'group_id' => 13037, // 时间段话术
'default_group_id' => 123 // 默认配置话术
]
]
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
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/f232d184-dd54-42a0-8ace-0bf8d660f4cc'
data = {
'name': '测试api接口创建-222',
'destination_extension': 102, # 话术分组id
'maximumcall': 1, # 并发总数 (线路总并发)
'dial_time_id': 5, # 呼叫时间组
'background_id': 52, # 背景音id 需要提供背景音列表等接口
'task_extras': {
'start_time': '2024-11-01 13:25:26', # 开始时间 (必填)
'stop_time': '2025-11-01 13:25:26', # 结束时间
'line': [], # line参数除外,不传线路,也需传递空数组
'holiday': [ # 假期时间 (选填)可设置多个
{
'begin': '2024-11-01 13:25',
'end': '2024-11-03 13:25'
}
]
},
'group_switch_rule': [ # 2.0-AI对话模型-按时间配置
{
'switch_start': '09:00', # 开始时间
'switch_end': '12:00', # 结束时间
'group_id': 13037, # 时间段话术
'default_group_id': 123 # 默认配置话术
}
]
}
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
}
response = requests.put(url, json=data, 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) {
std::string json_data = R"({
"name": "测试api接口创建-222",
"destination_extension": 102, // 话术分组id
"maximumcall": 1, // 并发总数 (线路总并发)
"dial_time_id": 5, // 呼叫时间组
"background_id": 52, // 背景音id 需要提供背景音列表等接口
"task_extras": {
"start_time": "2024-11-01 13:25:26", // 开始时间 (必填)
"stop_time": "2025-11-01 13:25:26", // 结束时间
"line": [], // line参数除外,不传线路,也需传递空数组
"holiday": [ // 假期时间 (选填)可设置多个
{
"begin": "2024-11-01 13:25",
"end": "2024-11-03 13:25"
}
]
},
"group_switch_rule": [ // 2.0-AI对话模型-按时间配置
{
"switch_start": "09:00", // 开始时间
"switch_end": "12:00", // 结束时间
"group_id": 13037, // 时间段话术
"default_group_id": 123 // 默认配置话术
}
]
})";
curl_easy_setopt(curl, CURLOPT_URL, "https://ai.api.longlonglong.cn/agent-api/new/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/task/f232d184-dd54-42a0-8ace-0bf8d660f4cc");
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, json_data.c_str());
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;
}请求参数
| 参数 | 类型 | 示例 | 解释 | 必填 |
|---|---|---|---|---|
| sub_user_id | string | 5b55bcca-d653-4a58-8f9a-437fb0601f8e | 子账户id(传递此参数则是对子账户操作) | 否 |
| bridge_group_id | int | 1 | 使用转接组的id 不传这个键,则表示为空。传了则必填 | 否 |
| destination_extension | int | 297 | 使用话术分组的id | 是 |
| dial_time_id | int | 5 | 呼叫时间组ID | 是 |
| maximumcall | int | 1 | 线路并发数 | 是 |
| name | string | 测试任务 | 任务名称 | 是 |
| remark | string | 第一个任务 | 任务描述 | 否 |
| auto_recycle_rule_id | int | 1 | 重呼规则id | 否 |
| elasticity_type | bool | FALSE | 动态坐席 | 否 |
| end_action | int | 1 | 任务结束动作 此动作不能与动态坐席同时开启 | 否 |
| background_id | int | 25 | 背景音id | 否 |
| llm_intention_id | string | "1" | 大模型质检配置id | 否 |
| task_extras | array | - | 2.0 任务配置信息 | 是 |
| task_extras.start_time | string | 2024/11/1 13:25 | 任务开始时间 | 是 |
| task_extras.stop_time | string | 2025/11/1 13:25 | 任务结束时间 | 是 |
| task_extras.holiday | array | [{"start":"2024-11-01 13:25","end":"2024-11-03 13:25"}] | 停止工作时间 (注意不传也需要传空数组值) | 否 |
| line | array | ["29c39ec4-b292-4af9-a88b-922d61866sub"] | 线路id (注意不传也需要传空数组值) | 否 |
| interval_time | int | 0 | 呼叫时间间隔(默认为0) | 否 |
| new_call_rules | array | - | 2.0任务重呼配置信息 | 否 |
| new_call_rules.*.re_call_time | date | 10:00:00 | 重呼执行时间 (时间范围10-11 13-22) | 否 |
| new_call_rules.*.call_interval | int | 60 | 呼叫间隔时间 (单位:分钟) | 否 |
| new_call_rules.*.rule_id | int | 15486 | 重呼规则id | 否 |
注意事项
- 除了必填以外,不用的参数可以不传(
line&holiday参数除外,不传线路信息也需传递空数组)。 - 请特别注意,为了方便2.0外呼任务,可使用旧时间组(
dial_time_id),进行创建或更新2.0任务操作,但时间组中工作时间的更新,目前并未与使用其的任务同步。 - 2.0 任务更新需要暂停任务才可进行更新。
- 如果使用2.0 任务,需暂停任务才可以修改 否则会出现以下报错。
json
{
"code": 6007,
"status": "error",
"message": "2.0任务启动中,请先停止任务",
"data": []
}maximumcall为所选线路的总并发数之和,每条所选线路使用的并发数为平均并发数,即设置总并发数,必须为设置线路数量整除。平均并发数不得超过选用线路的residue值
新版任务2.0
请求示例
cURL
curl -X PUT "https://ai.api.longlonglong.cn/agent-api/new/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/task/f232d184-dd54-42a0-8ace-0bf8d660f4cc" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{
"name": "测试api接口创建-222",
"group_type": "group",
"destination_extension": 123, // 话术分组id
"is_group_switch": 1, // 话术配置类型 0-统一配置 1-按时间配置 2-变量分组配置 3-多项外呼话术组配置
"maximumcall": 2, // 并发总数 (线路总并发)
"dial_time_id": 123, // 呼叫时间组
"background_id": 123, // 背景音id 需要提供背景音列表等接口
"task_extras": {
"start_time": "2024-12-23 19:00:00", // 开始时间 (必填)
"stop_time": "2025-12-25 23:59:59", // 结束时间
"line": [ // 新版2.0-任务线路参数,无数据也需传递空数组
{
"id": "d47c3599-f166-4cd0-999c-f60e46814d26", // 线路id
"limit": 2 // 最大并发
}
],
"destination_extension_list": [ // 新版2.0-AI对话模型-按时间配置
{
"begin": "09:00", // 开始时间
"end": "12:00", // 结束时间
"destination_extension": 123 // 该时间段内话术
}
],
"destination_extension_with_variable_list": [
// is_switch_group为2(按号码变量配置)时必填
// 变量话术组,可不配置,当号码中携带符合变量话术组配置时,会自动选择该话术组 (最多配置100个)
// 以下配置说明号码变量包含男,使用话术组ID:11
// 号码变量包含女,使用话术组12
// 号码变量其余值或者空,使用兜底话术组10
{
"mode": 1, // 模式 0-包含任一关键词、1-等于任一关键词
"values": [ // 关键词,最多10个,且不能有重复
"男",
"男的"
],
"destination_extension": 11, // 使用话术组
"sort": 1 // 排序,排序越大优先级越低
},
{
"mode": 0, // 模式 0-包含任一关键词、1-等于任一关键词
"values": [ // 关键词,最多10个,且不能有重复
"女",
"女性"
],
"destination_extension": 12, // 使用话术组
"sort": 0
},
{
"mode": 0, // 模式 0-包含任一关键词、1-等于任一关键词
"values": [ // 关键词,最多10个,且不能有重复
"未知"
],
"destination_extension": 10, // 使用话术组
"sort": 4
}
],
"destination_extension_multi_config": { // 多项外呼话术组配置
"dial_mode": 0, // 拨打模式,0:轮询 1:随机
"list": [
{
"destination_extension": "13601", // 话术组
"sort": 1 // 排序参数必须传递,当dial_mode为0时,sort字段是轮询的依据
},
{
"destination_extension": "13716", // 话术组
"sort": 2
}
]
},
"holiday": [], // 休息日
"work_hour": [], // 工作时间
"work_week": [], // 工作周
"pop_mode": 1, // (新2.0必填)弹出模式 0-随机弹出(默认) 1-顺序弹出 2-倒序弹出
"redial_enabled": 0, // 重呼配置(新2.0)
"redial_new_number_policy": 0, // 首次外呼优先(新2.0)
"redial_interval": 3, // 重呼间隔(新2.0)
"redial_max_times": 3, // 重呼次数(新2.0)
"redial_conditions": { // 重呼条件(新2.0)
"da_status": [
2, 3, 4, 6, 8, 9, 12 // 2=运营商拦截 3=拒接 4=无应答、无人接听 5=空号 6=关机 7=停机 8=占线、用户在忙 9=呼入限制 10=欠费 12=用户屏蔽
]
}
},
"llm_intention_id": "123", // 大模型质检id
"score_scheme_id": 123 // 打分方案id
}'Go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
url := "https://ai.api.longlonglong.cn/agent-api/new/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/task/f232d184-dd54-42a0-8ace-0bf8d660f4cc"
payload := map[string]interface{}{
"name": "测试api接口创建-222",
"group_type": "group",
"destination_extension": 123, // 话术分组id
"is_group_switch": 1, // 话术配置类型 0-统一配置 1-按时间配置 2-变量分组配置 3-多项外呼话术组配置
"maximumcall": 2, // 并发总数 (线路总并发)
"dial_time_id": 123, // 呼叫时间组
"background_id": 123, // 背景音id 需要提供背景音列表等接口
"llm_intention_id": "123", // 大模型质检id
"score_scheme_id": 123, // 打分方案id
"task_extras": map[string]interface{}{
"start_time": "2024-12-23 19:00:00", // 开始时间 (必填)
"stop_time": "2025-12-25 23:59:59", // 结束时间
"line": []map[string]interface{}{ // 新版2.0-任务线路参数
{
"id": "d47c3599-f166-4cd0-999c-f60e46814d26", // 线路id
"limit": 2, // 最大并发
},
},
"destination_extension_list": []map[string]interface{}{ // 新版2.0-AI对话模型-按时间配置
{
"begin": "09:00", // 开始时间
"end": "12:00", // 结束时间
"destination_extension": 123, // 该时间段内话术
},
},
"destination_extension_with_variable_list": []map[string]interface{}{
{
"mode": 1, // 模式 0-包含任一关键词、1-等于任一关键词
"values": []string{"男", "男的"}, // 关键词,最多10个
"destination_extension": 11, // 使用话术组
"sort": 1, // 排序,排序越大优先级越低
},
},
"destination_extension_multi_config": map[string]interface{}{ // 多项外呼话术组配置
"dial_mode": 0, // 拨打模式,0:轮询 1:随机
"list": []map[string]interface{}{
{
"destination_extension": "13601", // 话术组
"sort": 1, // 排序参数必须传递
},
},
},
"holiday": []interface{}{}, // 休息日
"work_hour": []interface{}{}, // 工作时间
"work_week": []interface{}{}, // 工作周
"pop_mode": 1, // (新2.0必填)弹出模式
"redial_enabled": 0, // 重呼配置(新2.0)
"redial_new_number_policy": 0, // 首次外呼优先(新2.0)
"redial_interval": 3, // 重呼间隔(新2.0)
"redial_max_times": 3, // 重呼次数(新2.0)
"redial_conditions": map[string]interface{}{ // 重呼条件(新2.0)
"da_status": []int{2, 3, 4, 6, 8, 9, 12},
},
},
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("PUT", url, bytes.NewBuffer(jsonData))
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');
const data = {
name: '测试api接口创建-222',
group_type: 'group',
destination_extension: 123, // 话术分组id
is_group_switch: 1, // 话术配置类型 0-统一配置 1-按时间配置 2-变量分组配置 3-多项外呼话术组配置
maximumcall: 2, // 并发总数 (线路总并发)
dial_time_id: 123, // 呼叫时间组
background_id: 123, // 背景音id 需要提供背景音列表等接口
llm_intention_id: "123", // 大模型质检id
score_scheme_id: 123, // 打分方案id
task_extras: {
start_time: '2024-12-23 19:00:00', // 开始时间 (必填)
stop_time: '2025-12-25 23:59:59', // 结束时间
line: [ // 新版2.0-任务线路参数
{
id: 'd47c3599-f166-4cd0-999c-f60e46814d26', // 线路id
limit: 2 // 最大并发
}
],
destination_extension_list: [ // 新版2.0-AI对话模型-按时间配置
{
begin: '09:00', // 开始时间
end: '12:00', // 结束时间
destination_extension: 123 // 该时间段内话术
}
],
destination_extension_with_variable_list: [
{
mode: 1, // 模式 0-包含任一关键词、1-等于任一关键词
values: ['男', '男的'], // 关键词,最多10个
destination_extension: 11, // 使用话术组
sort: 1 // 排序,排序越大优先级越低
}
],
destination_extension_multi_config: { // 多项外呼话术组配置
dial_mode: 0, // 拨打模式,0:轮询 1:随机
list: [
{
destination_extension: '13601', // 话术组
sort: 1 // 排序参数必须传递
}
]
},
holiday: [], // 休息日
work_hour: [], // 工作时间
work_week: [], // 工作周
pop_mode: 1, // (新2.0必填)弹出模式
redial_enabled: 0, // 重呼配置(新2.0)
redial_new_number_policy: 0, // 首次外呼优先(新2.0)
redial_interval: 3, // 重呼间隔(新2.0)
redial_max_times: 3, // 重呼次数(新2.0)
redial_conditions: { // 重呼条件(新2.0)
da_status: [2, 3, 4, 6, 8, 9, 12]
}
}
};
axios.put('https://ai.api.longlonglong.cn/agent-api/new/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/task/f232d184-dd54-42a0-8ace-0bf8d660f4cc', data, {
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/f232d184-dd54-42a0-8ace-0bf8d660f4cc";
String json = """
{
"name": "测试api接口创建-222",
"group_type": "group",
"destination_extension": 123, // 话术分组id
"is_group_switch": 1, // 话术配置类型
"maximumcall": 2, // 并发总数 (线路总并发)
"dial_time_id": 123, // 呼叫时间组
"background_id": 123, // 背景音id
"llm_intention_id": "123", // 大模型质检id
"score_scheme_id": 123, // 打分方案id
"task_extras": {
"start_time": "2024-12-23 19:00:00", // 开始时间 (必填)
"stop_time": "2025-12-25 23:59:59", // 结束时间
"line": [{"id": "d47c3599-f166-4cd0-999c-f60e46814d26", "limit": 2}], // 新版2.0-任务线路参数
"destination_extension_list": [{"begin": "09:00", "end": "12:00", "destination_extension": 123}], // 按时间配置
"holiday": [], // 休息日
"pop_mode": 1, // (新2.0必填)弹出模式
"redial_enabled": 0, // 重呼配置(新2.0)
"redial_new_number_policy": 0, // 首次外呼优先(新2.0)
"redial_interval": 3, // 重呼间隔(新2.0)
"redial_max_times": 3, // 重呼次数(新2.0)
"redial_conditions": {"da_status": [2, 3, 4, 6, 8, 9, 12]} // 重呼条件(新2.0)
}
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Content-Type", "application/json")
.header("Authorization", "Bearer YOUR_TOKEN")
.PUT(HttpRequest.BodyPublishers.ofString(json))
.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/f232d184-dd54-42a0-8ace-0bf8d660f4cc';
$data = [
'name' => '测试api接口创建-222',
'group_type' => 'group',
'destination_extension' => 123, // 话术分组id
'is_group_switch' => 1, // 话术配置类型 0-统一配置 1-按时间配置 2-变量分组配置 3-多项外呼话术组配置
'maximumcall' => 2, // 并发总数 (线路总并发)
'dial_time_id' => 123, // 呼叫时间组
'background_id' => 123, // 背景音id 需要提供背景音列表等接口
'llm_intention_id' => "123", // 大模型质检id
'score_scheme_id' => 123, // 打分方案id
'task_extras' => [
'start_time' => '2024-12-23 19:00:00', // 开始时间 (必填)
'stop_time' => '2025-12-25 23:59:59', // 结束时间
'line' => [ // 新版2.0-任务线路参数
['id' => 'd47c3599-f166-4cd0-999c-f60e46814d26', 'limit' => 2]
],
'destination_extension_list' => [ // 新版2.0-AI对话模型-按时间配置
['begin' => '09:00', 'end' => '12:00', 'destination_extension' => 123]
],
'destination_extension_with_variable_list' => [
[
'mode' => 1, // 模式 0-包含任一关键词、1-等于任一关键词
'values' => ['男', '男的'], // 关键词,最多10个
'destination_extension' => 11, // 使用话术组
'sort' => 1 // 排序,排序越大优先级越低
]
],
'destination_extension_multi_config' => [ // 多项外呼话术组配置
'dial_mode' => 0, // 拨打模式,0:轮询 1:随机
'list' => [
['destination_extension' => '13601', 'sort' => 1]
]
],
'holiday' => [], // 休息日
'work_hour' => [], // 工作时间
'work_week' => [], // 工作周
'pop_mode' => 1, // (新2.0必填)弹出模式
'redial_enabled' => 0, // 重呼配置(新2.0)
'redial_new_number_policy' => 0, // 首次外呼优先(新2.0)
'redial_interval' => 3, // 重呼间隔(新2.0)
'redial_max_times' => 3, // 重呼次数(新2.0)
'redial_conditions' => [ // 重呼条件(新2.0)
'da_status' => [2, 3, 4, 6, 8, 9, 12]
]
]
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
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/f232d184-dd54-42a0-8ace-0bf8d660f4cc'
data = {
'name': '测试api接口创建-222',
'group_type': 'group',
'destination_extension': 123, # 话术分组id
'is_group_switch': 1, # 话术配置类型 0-统一配置 1-按时间配置 2-变量分组配置 3-多项外呼话术组配置
'maximumcall': 2, # 并发总数 (线路总并发)
'dial_time_id': 123, # 呼叫时间组
'background_id': 123, # 背景音id 需要提供背景音列表等接口
'llm_intention_id': "123", # 大模型质检id
'score_scheme_id': 123, # 打分方案id
'task_extras': {
'start_time': '2024-12-23 19:00:00', # 开始时间 (必填)
'stop_time': '2025-12-25 23:59:59', # 结束时间
'line': [ # 新版2.0-任务线路参数
{'id': 'd47c3599-f166-4cd0-999c-f60e46814d26', 'limit': 2}
],
'destination_extension_list': [ # 新版2.0-AI对话模型-按时间配置
{'begin': '09:00', 'end': '12:00', 'destination_extension': 123}
],
'destination_extension_with_variable_list': [
{
'mode': 1, # 模式 0-包含任一关键词、1-等于任一关键词
'values': ['男', '男的'], # 关键词,最多10个
'destination_extension': 11, # 使用话术组
'sort': 1 # 排序,排序越大优先级越低
}
],
'destination_extension_multi_config': { # 多项外呼话术组配置
'dial_mode': 0, # 拨打模式,0:轮询 1:随机
'list': [
{'destination_extension': '13601', 'sort': 1}
]
},
'holiday': [], # 休息日
'work_hour': [], # 工作时间
'work_week': [], # 工作周
'pop_mode': 1, # (新2.0必填)弹出模式
'redial_enabled': 0, # 重呼配置(新2.0)
'redial_new_number_policy': 0, # 首次外呼优先(新2.0)
'redial_interval': 3, # 重呼间隔(新2.0)
'redial_max_times': 3, # 重呼次数(新2.0)
'redial_conditions': { # 重呼条件(新2.0)
'da_status': [2, 3, 4, 6, 8, 9, 12]
}
}
}
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
}
response = requests.put(url, json=data, 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) {
std::string json_data = R"({
"name": "测试api接口创建-222",
"group_type": "group",
"destination_extension": 123, // 话术分组id
"is_group_switch": 1, // 话术配置类型
"maximumcall": 2, // 并发总数 (线路总并发)
"dial_time_id": 123, // 呼叫时间组
"background_id": 123, // 背景音id
"llm_intention_id": "123", // 大模型质检id
"score_scheme_id": 123, // 打分方案id
"task_extras": {
"start_time": "2024-12-23 19:00:00", // 开始时间 (必填)
"stop_time": "2025-12-25 23:59:59", // 结束时间
"line": [{"id": "d47c3599-f166-4cd0-999c-f60e46814d26", "limit": 2}], // 新版2.0-任务线路参数
"destination_extension_list": [{"begin": "09:00", "end": "12:00", "destination_extension": 123}], // 按时间配置
"holiday": [], // 休息日
"pop_mode": 1, // (新2.0必填)弹出模式
"redial_enabled": 0, // 重呼配置(新2.0)
"redial_new_number_policy": 0, // 首次外呼优先(新2.0)
"redial_interval": 3, // 重呼间隔(新2.0)
"redial_max_times": 3, // 重呼次数(新2.0)
"redial_conditions": {"da_status": [2, 3, 4, 6, 8, 9, 12]} // 重呼条件(新2.0)
}
})";
curl_easy_setopt(curl, CURLOPT_URL, "https://ai.api.longlonglong.cn/agent-api/new/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/task/f232d184-dd54-42a0-8ace-0bf8d660f4cc");
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, json_data.c_str());
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;
}请求参数
| 参数 | 类型 | 示例 | 解释 | 必填 |
|---|---|---|---|---|
| sub_user_id | string | 5b55bcca-d653-4a58-8f9a-437fb0601f8e | 子账户id(传递此参数则是对子账户操作) | 否 |
| bridge_group_id | int | 1 | 使用转接组的id 不传这个键,则表示为空。传了则必填 | 否 |
| destination_extension | int | 297 | 使用话术分组的id | 是 |
| dial_time_id | int | 5 | 呼叫时间组ID | 是 |
| maximumcall | int | 1 | 线路并发数 | 是 |
| name | string | 测试任务 | 任务名称 | 是 |
| remark | string | 第一个任务 | 任务描述 | 否 |
| auto_recycle_rule_id | int | 1 | 重呼规则id | 否 |
| elasticity_type | bool | FALSE | 动态坐席 | 否 |
| end_action | int | 1 | 任务结束动作 此动作不能与动态坐席同时开启 | 否 |
| background_id | int | 25 | 背景音id | 否 |
| llm_intention_id | string | "1" | 大模型质检配置id | 否 |
| task_extras | array | - | 2.0 任务配置信息 | 是 |
| task_extras.start_time | string | 2024/11/1 13:25 | 任务开始时间 | 是 |
| task_extras.stop_time | string | 2025/11/1 13:25 | 任务结束时间 | 是 |
| task_extras.holiday | array | [{"start":"2024-11-01 13:25","end":"2024-11-03 13:25"}] | 停止工作时间 | 否 (注意不传也需要传空数组值) |
| line | array | ["29c39ec4-b292-4af9-a88b-922d61866sub"] | 线路id | 否 (注意不传也需要传空数组值) |
| interval_time | int | 0 | 呼叫时间间隔(默认为0) | 否 |
| new_call_rules | array | - | 2.0任务重呼配置信息 | 否 |
| new_call_rules.*.re_call_time | date | 10:00:00 | 重呼执行时间 (时间范围10-11 13-22) | 否 |
| new_call_rules.*.call_interval | int | 60 | 呼叫间隔时间 (单位:分钟) | 否 |
| new_call_rules.*.rule_id | int | 15486 | 重呼规则id | 否 |
| task_extras.destination_extension_list | array | [{"begin":"09:00","end":"12:00","destination_extension":"215870475195883520"}] | AI对话模型-按时间配置 | 否 |
| task_extras.destination_extension_with_variable_list | array | [{"mode":1,"values":["男","男的"],"destination_extension":11,"sort":1}] | AI对话模型-按号码变量配置 (is_group_switch为2时必填) | 否 |
| task_extras.destination_extension_multi_config | object | {"dial_mode":0,"list":[{"destination_extension":"13601","sort":1},{"destination_extension":"13716","sort":2}]} | AI对话模型-多项外呼话术组配置 (is_group_switch为3时必填) | 否 |
| task_extras.redial_enabled | bool | 1 | 重呼配置 | 否 |
| task_extras.redial_new_number_policy | bool | 1 | 首次外呼优先 | 否 |
| task_extras.redial_interval | int | 3 | 重呼间隔 最多60分钟 | 否 |
| task_extras.redial_max_times | int | 3 | 重呼次数 最多3次 | 否 |
| task_extras.da_status | array | [2,3,4,6,8,9,12] | 重呼状态 2=运营商拦截 3=拒接 4=无应答、无人接听 5=空号 6=关机 7=停机 8=占线、用户在忙 9=呼入限制 10=欠费 12=用户屏蔽 | 否 |
| task_extras.pop_mode | int | 0 | 弹出模式 0=随机 1=顺序 2=倒序 | 是 |
返回参数
json
{
"code": 200,
"status": "success",
"message": "修改成功",
"data": ""
}