Skip to content

号码列表

接口信息

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

路由参数

参数类型示例解释必填
user_idstring5832d184-dd53-42a0-8ace-0bf8d660f4cc用户 id
task_idstringf232d184-dd54-42a0-8ace-0bf8d660f4cc任务 id

请求参数

参数类型示例解释必填
pageint1分页
per_pageint15每页个数
encryptionboolFALSE是否加密号码(开启接口加密后有效)
sub_user_idstring1181ffd3-e3ee-4d75-a45c-8b9be3deb330子账户 id否(传递此参数则是对子账户操作)
statusarray[2]筛选状态参数
start_atdate2025/12/3 0:00创建时间筛选参数
end_atdate2025/12/3 23:59创建时间筛选参数

请求示例

cURL
curl -X GET "https://ai.api.longlonglong.cn/agent-api/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/task/f232d184-dd54-42a0-8ace-0bf8d660f4cc/number?page=1&per_page=15&encryption=false" \
  -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/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/task/f232d184-dd54-42a0-8ace-0bf8d660f4cc/number?page=1&per_page=15&encryption=false"

    req, _ := http.NewRequest("GET", url, nil)
    req.Header.Set("Content-Type", "application/json")
    req.Header.Set("Authorization", "Bearer YOUR_TOKEN")

    client := &http.Client{}
    resp, _ := client.Do(req)
    defer resp.Body.Close()

    body, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body))
}
JavaScript
const url = "https://ai.api.longlonglong.cn/agent-api/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/task/f232d184-dd54-42a0-8ace-0bf8d660f4cc/number?page=1&per_page=15&encryption=false";

fetch(url, {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer YOUR_TOKEN"
  }
})
  .then(response => response.json())
  .then(result => console.log(result))
  .catch(error => console.error("Error:", error));
Java
import java.net.HttpURLConnection;
import java.net.URL;
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws Exception {
        String url = "https://ai.api.longlonglong.cn/agent-api/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/task/f232d184-dd54-42a0-8ace-0bf8d660f4cc/number?page=1&per_page=15&encryption=false";

        URL obj = new URL(url);
        HttpURLConnection con = (HttpURLConnection) obj.openConnection();
        con.setRequestMethod("GET");
        con.setRequestProperty("Content-Type", "application/json");
        con.setRequestProperty("Authorization", "Bearer YOUR_TOKEN");

        BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
        String inputLine;
        StringBuilder response = new StringBuilder();
        while ((inputLine = in.readLine()) != null) {
            response.append(inputLine);
        }
        in.close();

        System.out.println(response.toString());
    }
}
PHP
<?php

$url = "https://ai.api.longlonglong.cn/agent-api/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/task/f232d184-dd54-42a0-8ace-0bf8d660f4cc/number?page=1&per_page=15&encryption=false";

$ch = curl_init($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/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/task/f232d184-dd54-42a0-8ace-0bf8d660f4cc/number"
params = {
    "page": 1,
    "per_page": 15,
    "encryption": False
}

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>

int main() {
    CURL* curl;
    CURLcode res;

    curl = curl_easy_init();
    if (curl) {
        std::string url = "https://ai.api.longlonglong.cn/agent-api/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/task/f232d184-dd54-42a0-8ace-0bf8d660f4cc/number?page=1&per_page=15&encryption=false";

        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_URL, url.c_str());
        curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);

        res = curl_easy_perform(curl);

        if (res != CURLE_OK) {
            std::cerr << "curl_easy_perform() failed: " << curl_easy_strerror(res) << std::endl;
        }

        curl_easy_cleanup(curl);
    }

    return 0;
}

返回示例

json
{
    "code": 200, // 状态码
    "status": "success", // 请求状态
    "message": "查看号码列表成功", // 响应消息
    "data": [ // 号码列表
        {
            "number": "18651683344", // 号码
            "city": "邢台", // 城市
            "pro": "河北", // 省份
            "mobile_type": "联通", // 运营商
            "area_code": "0319", // 区号
            "post_code": "054000", // 邮编
            "extra": "0c51fc89-f6cf-405b-bb36-2c06900c3b5e", // 额外数据,可用于标识第三方数据,确保号码数据导入客户公海即可生效
            "id": 258, // 号码id
            "status_str": "等待呼叫", // 状态
            "callid": "3d24c948-378e-43b0-b3b8-5dc176272ca3", // 通话id
            "calldate": "2020-10-13 18:07:03", // 呼叫时间
            "bill": 47280, // 计费时间(毫秒)
            "duration": 56920, // 拨打时间(毫秒)
            "hangupcause": "NORMAL_CLEARING", // 挂断原因
            "hangupdate": "2020-10-12 11:08:05", // 挂断时间
            "answerdate": "2020-10-12 11:07:18", // 接听时间
            "is_blacklist": null, // 是否在黑名单中
            "status": 1, // 呼叫状态
            "customer_id": "ab4490e6-0174-47c1-b155-0040fd4c6b7a", // 对应CRM id
            "created_at": "2020-07-28 14:37:30" // 创建时间
        }
    ],
    "meta": { // 分页信息
        "has_pages": true, // 是否存在分页
        "total": 1, // 总条数
        "last_page": 1, // 最后一页页码
        "current_page": 1, // 当前页码
        "per_page": 15 // 每页条数
    }
}

status 呼叫状态说明

说明
0等待呼叫
1呼叫成功
2运营商拦截
3拒接
4无应答/无人接听
5空号
6关机
7停机
8占线/用户正忙
9呼入限制
10欠费
11黑名单
12用户屏蔽

字段说明

字段说明
bill计费时间(毫秒)
duration拨打时间(毫秒)
extra额外数据,可用于标识第三方数据

基于 MIT 许可发布