Skip to content

任务列表(所有子账号)

请求信息

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

路由参数

参数类型示例解释必填
user_idstring5832d184-dd53-42a0-8ace-0bf8d660f4cc用户 id(主账号)

请求参数

参数类型示例解释必填
pageint1页码
per_pageint15每页个数
namestring任务任务名称

请求示例

cURL
curl -X GET "https://ai.api.longlonglong.cn/agent-api/new/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/subset_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/subset_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/subset_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/subset_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/subset_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/subset_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/subset_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;
}

响应示例

json
{
    "code": 200,
    "status": "success",
    "message": "返回所有子账号的任务列表信息成功",
    "meta": {
        "has_pages": true,
        "total": 3,
        "last_page": 3,
        "current_page": 1,
        "per_page": "1"
    },
    "data": [
        {
            "uuid": "dc7dd781-6d8a-42b1-9402-6d57636a8513",
            "name": "子账户",
            "create_datetime": "2024-09-02 21:45:18",
            "alter_datetime": "2024-09-02 21:45:18",
            "start": 0,
            "enable": false,
            "maximumcall": 10,
            "call_per_second": 10,
            "recycle_limit": 0,
            "random_assignment_number": 0,
            "disable_dial_timegroup": null,
            "dial_time_id": 96,
            "destination_extension": "101",
            "group_type": "group",
            "destination_dialplan": "XML",
            "destination_context": "default",
            "scheduling_policy_ratio": null,
            "scheduling_queue": null,
            "dial_format": "user/0000",
            "domain": null,
            "remark": null,
            "sort": 3,
            "originate_variables": "{execute_on_media=start_da}",
            "_originate_timeout": 60,
            "_origination_caller_id_number": "20101",
            "user_id": "4e92e425-036e-4759-b594-ee6911605533",
            "auto_recycle_rule_id": 94,
            "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": 1,
            "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,
            "background": "",
            "is_group_switch": 0,
            "task_extras": {
                "line": [],
                "stop_time": "2025-11-01 13:25:26",
                "work_hour": [
                    {
                        "end": "12:00",
                        "wday": 0,
                        "begin": "09:00"
                    },
                    {
                        "end": "18:00",
                        "wday": 0,
                        "begin": "13:00"
                    },
                    {
                        "end": "12:00",
                        "wday": 1,
                        "begin": "09:00"
                    },
                    {
                        "end": "18:00",
                        "wday": 1,
                        "begin": "13:00"
                    },
                    {
                        "end": "12:00",
                        "wday": 2,
                        "begin": "09:00"
                    },
                    {
                        "end": "18:00",
                        "wday": 2,
                        "begin": "13:00"
                    },
                    {
                        "end": "12:00",
                        "wday": 3,
                        "begin": "09:00"
                    },
                    {
                        "end": "18:00",
                        "wday": 3,
                        "begin": "13:00"
                    },
                    {
                        "end": "12:00",
                        "wday": 4,
                        "begin": "09:00"
                    },
                    {
                        "end": "18:00",
                        "wday": 4,
                        "begin": "13:00"
                    },
                    {
                        "end": "12:00",
                        "wday": 5,
                        "begin": "09:00"
                    },
                    {
                        "end": "18:00",
                        "wday": 5,
                        "begin": "13:00"
                    },
                    {
                        "end": "12:00",
                        "wday": 6,
                        "begin": "09:00"
                    },
                    {
                        "end": "18:00",
                        "wday": 6,
                        "begin": "13:00"
                    }
                ],
                "work_week": [0, 1, 2, 3, 4, 5, 6],
                "start_time": "2024-11-01 13:25:26"
            },
            "status_str": "停止",
            "call_status": true,
            "task_cause": [
                "任务结束时间不能早于当前时间",
                "任务结束时间不符合"
            ],
            "new_task_extra": {
                "name": "测试接口更新任务",
                "enable": false,
                "line": ["xxxx"],
                "limit": 1,
                "cps": 1,
                "start_time": "2024-11-01 13:25:26",
                "stop_time": "2025-11-01 13:25:26",
                "work_week": [0, 1, 2, 3, 4, 5, 6],
                "work_hour": [
                    {
                        "wday": "-1",
                        "begin": "09:00",
                        "end": "12:00"
                    },
                    {
                        "wday": "-1",
                        "begin": "13:00",
                        "end": "18:00"
                    }
                ],
                "destination_extension": "105",
                "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"
                    ]
                },
                "blacklist": "",
                "background": "",
                "call_status": false,
                "number_count": 0,
                "call_info": []
            },
            "caller_line": null,
            "auto_recycle_rule": null,
            "group": {
                "id": 101,
                "name": "测试2222",
                "default": false
            },
            "llm_intention_config": null,
            "status": 1
        }
    ]
}

注意事项

💡请特别注意

  1. 为了方便2.0外呼任务,可使用旧时间组 (dial_time_id),进行创建或更新2.0任务操作,但时间组中工作时间的更新,目前并未与使用其的任务同步

  2. 任务状态根据enable和远程任务(new_task_extra)中的call_status判断任务状态

    enablecall_status任务状态
    truetrue任务拨打中
    falsefalse任务暂停中
    truefalse停止
  3. 远程任务字段 new_task_extra 值为空,则为异常任务,请删除重新创建

基于 MIT 许可发布