Skip to content

任务编辑

请求信息

  • 接口: /agent-api/new/user/{user_id}/task/{task_id}/edit
  • 请求方式: GET

路由参数

参数类型示例解释必填
user_idstring5832d184-dd53-42a0-8ace-0bf8d660f4cc用户ID
task_idstringdc7dd781-6d8a-42b1-9402-6d57636a8513任务ID

请求参数

参数类型示例解释必填
sub_user_idstring876e5d57-fd76-4109-8b15-6726f1ec2dfa子账户ID(传递此参数则是对子账户操作)

请求示例

cURL
curl -X GET "https://ai.api.longlonglong.cn/agent-api/new/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/task/dc7dd781-6d8a-42b1-9402-6d57636a8513/edit" \
  -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/dc7dd781-6d8a-42b1-9402-6d57636a8513/edit"

    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/dc7dd781-6d8a-42b1-9402-6d57636a8513/edit', {
    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/dc7dd781-6d8a-42b1-9402-6d57636a8513/edit";

        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/dc7dd781-6d8a-42b1-9402-6d57636a8513/edit';

$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/dc7dd781-6d8a-42b1-9402-6d57636a8513/edit'

headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_TOKEN'
}

response = requests.get(url, 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/dc7dd781-6d8a-42b1-9402-6d57636a8513/edit");

        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

响应示例

json
{
    "code": 200,
    "status": "success",
    "message": "返回任务信息成功",
    "data": {
        "task_type": 7,
        "maximumcall": 2,
        "recycle_limit": 0,
        "name": "测试api接口创建-1766971470",
        "remark": null,
        "destination_extension": "XXX",
        "random_assignment_number": 0,
        "_originate_timeout": 60,
        "bridge_group_id": null,
        "auto_recycle_rule_id": null,
        "dial_time_id": 96,
        "end_action": null,
        "llm_intention_id": 406,
        "new_task_extra": {
            "id": "XXXX",
            "name": "测试api接口创建-1766971470",
            "enable": false,
            "line": [
                {
                    "id": "XXX",
                    "limit": 2
                }
            ],
            "limit": 2,
            "cps": 1,
            "start_time": "2024-12-23 19:00:00",
            "stop_time": "2025-12-25 23:59:59",
            "holiday": [],
            "work_week": [0, 1, 2, 3, 4, 5, 6],
            "work_hour": [
                {
                    "wday": "0",
                    "begin": "09:00",
                    "end": "12:00"
                },
                {
                    "wday": "0",
                    "begin": "13:00",
                    "end": "23:59"
                },
                {
                    "wday": "1",
                    "begin": "09:00",
                    "end": "12:00"
                },
                {
                    "wday": "1",
                    "begin": "13:00",
                    "end": "23:59"
                },
                {
                    "wday": "2",
                    "begin": "09:00",
                    "end": "12:00"
                },
                {
                    "wday": "2",
                    "begin": "13:00",
                    "end": "23:59"
                },
                {
                    "wday": "3",
                    "begin": "09:00",
                    "end": "12:00"
                },
                {
                    "wday": "3",
                    "begin": "13:00",
                    "end": "23:59"
                },
                {
                    "wday": "4",
                    "begin": "09:00",
                    "end": "12:00"
                },
                {
                    "wday": "4",
                    "begin": "13:00",
                    "end": "23:59"
                },
                {
                    "wday": "5",
                    "begin": "09:00",
                    "end": "12:00"
                },
                {
                    "wday": "5",
                    "begin": "13:00",
                    "end": "23:59"
                },
                {
                    "wday": "6",
                    "begin": "09:00",
                    "end": "12:00"
                },
                {
                    "wday": "6",
                    "begin": "13:00",
                    "end": "23:59"
                }
            ],
            "destination_extension": "XXX",
            "destination_extension_list": [
                {
                    "begin": "09:00",
                    "end": "12:00",
                    "destination_extension": "XXXXX"
                }
            ],
            "redial_enabled": false,
            "redial_new_number_policy": false,
            "redial_interval": 3,
            "redial_max_times": 3,
            "redial_conditions": {
                "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"
                ]
            },
            "pop_mode": 1,
            "plan_stop_code": 0,
            "account_id": "XXX"
        },
        "background_id": 52,
        "is_active": 1,
        "task_cause": [
            "任务结束时间不能早于当前时间",
            "任务未开启",
            "任务结束时间不符合"
        ],
        "call_status": false,
        "caller_line_name": null,
        "destination_extension_name": "7777777777",
        "status": 1,
        "status_str": "停止",
        "elasticity_task": false,
        "task_extras": {
            "line": [
                {
                    "id": "d47c3599-f166-4cd0-999c-f60e46814d26",
                    "limit": 2
                }
            ],
            "holiday": [],
            "pop_mode": 1,
            "stop_time": "2025-12-25 23:59:59",
            "work_hour": [
                {
                    "end": "12:00",
                    "wday": 0,
                    "begin": "09:00"
                },
                {
                    "end": "23:59",
                    "wday": 0,
                    "begin": "13:00"
                },
                {
                    "end": "12:00",
                    "wday": 1,
                    "begin": "09:00"
                },
                {
                    "end": "23:59",
                    "wday": 1,
                    "begin": "13:00"
                },
                {
                    "end": "12:00",
                    "wday": 2,
                    "begin": "09:00"
                },
                {
                    "end": "23:59",
                    "wday": 2,
                    "begin": "13:00"
                },
                {
                    "end": "12:00",
                    "wday": 3,
                    "begin": "09:00"
                },
                {
                    "end": "23:59",
                    "wday": 3,
                    "begin": "13:00"
                },
                {
                    "end": "12:00",
                    "wday": 4,
                    "begin": "09:00"
                },
                {
                    "end": "23:59",
                    "wday": 4,
                    "begin": "13:00"
                },
                {
                    "end": "12:00",
                    "wday": 5,
                    "begin": "09:00"
                },
                {
                    "end": "23:59",
                    "wday": 5,
                    "begin": "13:00"
                },
                {
                    "end": "12:00",
                    "wday": 6,
                    "begin": "09:00"
                },
                {
                    "end": "23:59",
                    "wday": 6,
                    "begin": "13:00"
                }
            ],
            "work_week": [0, 1, 2, 3, 4, 5, 6],
            "start_time": "2024-12-23 19:00:00",
            "redial_enabled": 0,
            "destination_extension_list": [
                {
                    "end": "12:00",
                    "begin": "09:00",
                    "destination_extension": "215870475195883520"
                }
            ],
            "interval_recall": 0
        },
        "components": []
    }
}

旧版任务2.0

响应示例

json
{
    "code": 200,
    "status": "success",
    "message": "返回任务信息成功",
    "data": {
        "maximumcall": 1,
        "recycle_limit": 0,
        "name": "测试api创建-2",
        "remark": null,
        "destination_extension": "17075",
        "random_assignment_number": 0,
        "_originate_timeout": 60,
        "bridge_group_id": null,
        "auto_recycle_rule_id": null,
        "dial_time_id": 320,
        "end_action": null,
        "llm_intention_id": 0,
        "new_task_extra": {
            "name": "测试api创建-2",
            "enable": false,
            "line": [
                "ac43706d-01b0-4fa8-b24b-a8549eb93b1b"
            ],
            "limit": 1,
            "cps": 1,
            "start_time": "2024-11-01 13:25:26",
            "stop_time": "2025-11-01 13:25:26",
            "holiday": [
                {
                    "begin": "2024-11-01 13:25",
                    "end": "2024-11-03 13:25"
                }
            ],
            "work_week": [0, 1, 2, 3, 4, 5, 6],
            "work_hour": [
                {
                    "wday": "-1",
                    "begin": "00:00",
                    "end": "23:59"
                }
            ],
            "destination_extension": "17075",
            "call_status": false,
            "number_count": 2,
            "call_info": []
        },
        "background_id": null,
        "caller_line_name": null,
        "destination_extension_name": "cbq测试话术",
        "status": 1,
        "call_status": false,
        "status_str": "停止",
        "elasticity_task": false,
        "task_extras": {
            "line": [
                "ac43706d-01b0-4fa8-b24b-a8549eb93b1b"
            ],
            "holiday": [],
            "stop_time": "2025-11-01 13:25:26",
            "work_hour": [
                {
                    "end": "23:59",
                    "wday": 0,
                    "begin": "00:00"
                },
                {
                    "end": "23:59",
                    "wday": 1,
                    "begin": "00:00"
                },
                {
                    "end": "23:59",
                    "wday": 2,
                    "begin": "00:00"
                },
                {
                    "end": "23:59",
                    "wday": 3,
                    "begin": "00:00"
                },
                {
                    "end": "23:59",
                    "wday": 4,
                    "begin": "00:00"
                },
                {
                    "end": "23:59",
                    "wday": 5,
                    "begin": "00:00"
                },
                {
                    "end": "23:59",
                    "wday": 6,
                    "begin": "00:00"
                }
            ],
            "work_week": [0, 1, 2, 3, 4, 5, 6],
            "start_time": "2024-11-01 13:25:26"
        },
        "components": [
            {
                "id": "88e98345-839e-4304-b07f-350e54fa2e28",
                "name": "微信",
                "type": "text",
                "sort": 1,
                "validate": ["sometimes"]
            }
        ]
    }
}

参数说明

字段类型说明
namestring任务名称
maximumcallint最大并发呼叫
call_per_secondintCPS 每秒最大发起多少个呼叫
recycle_limitint号码最大回收次数(废弃)
random_assignment_numberint是否随机分配号码(废弃)
dial_time_idint呼叫时间 id
destination_extensionint话术组 id
remarkstring任务别名(备注)
originate_timeoutint拨号超时
auto_recycle_rule_idstring重呼规则 id
bridge_group_p_idint转接组 id
end_actionint任务结束动作 0-无操作 1-暂停任务释放并发
llm_intention_idint大模型意向标签配置 id
background_idint背景音 id
task_extrasjson任务额外信息
status_strstring任务状态转译
new_task_extrajson任务额外信息(2.0)
statusint状态
componentsarray绑定话术组使用的动态变量(仅限于常规外呼任务)
start_timedatetime开始时间
interval_timeint呼叫间隔时间

基于 MIT 许可发布