Appearance
号码列表
接口信息
- 接口:
/agent-api/user/{user_id}/task/{task_id}/number - 请求方式:
GET
路由参数
| 参数 | 类型 | 示例 | 解释 | 必填 |
|---|---|---|---|---|
| user_id | string | 5832d184-dd53-42a0-8ace-0bf8d660f4cc | 用户 id | 是 |
| task_id | string | f232d184-dd54-42a0-8ace-0bf8d660f4cc | 任务 id | 是 |
请求参数
| 参数 | 类型 | 示例 | 解释 | 必填 |
|---|---|---|---|---|
| page | int | 1 | 分页 | 是 |
| per_page | int | 15 | 每页个数 | 否 |
| encryption | bool | FALSE | 是否加密号码(开启接口加密后有效) | 否 |
| sub_user_id | string | 1181ffd3-e3ee-4d75-a45c-8b9be3deb330 | 子账户 id | 否(传递此参数则是对子账户操作) |
| status | array | [2] | 筛选状态参数 | 否 |
| start_at | date | 2025/12/3 0:00 | 创建时间筛选参数 | 否 |
| end_at | date | 2025/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 | 额外数据,可用于标识第三方数据 |