Appearance
线路列表
当前伙伴的所有线路列表
接口信息
- 接口:
/agent-api/new_line_list - 请求方式:
GET - 需要鉴权: 是
请求参数
| 参数 | 类型 | 描述 | 必填 |
|---|---|---|---|
| id | string | 云节点 ID | 是 |
| page | int | 页码 | 否 |
| per_page | int | 页容量 | 否 |
| user_id | string | 所属用户 ID | 否 |
请求示例
cURL
curl -X GET "https://ai.api.longlonglong.cn/agent-api/new_line_list?id=2533f3f6-7ac1-4b55-b1de-7d308ce00d89&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() {
client := &http.Client{}
req, err := http.NewRequest("GET", "https://ai.api.longlonglong.cn/agent-api/new_line_list?id=2533f3f6-7ac1-4b55-b1de-7d308ce00d89&page=1&per_page=15", nil)
if err != nil {
panic(err)
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Bearer YOUR_TOKEN")
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_line_list', {
params: {
id: '2533f3f6-7ac1-4b55-b1de-7d308ce00d89',
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);
});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 {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://ai.api.longlonglong.cn/agent-api/new_line_list?id=2533f3f6-7ac1-4b55-b1de-7d308ce00d89&page=1&per_page=15"))
.header("Content-Type", "application/json")
.header("Authorization", "Bearer YOUR_TOKEN")
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://ai.api.longlonglong.cn/agent-api/new_line_list?id=2533f3f6-7ac1-4b55-b1de-7d308ce00d89&page=1&per_page=15');
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_line_list'
params = {
'id': '2533f3f6-7ac1-4b55-b1de-7d308ce00d89',
'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 <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_line_list?id=2533f3f6-7ac1-4b55-b1de-7d308ce00d89&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);
if(res != CURLE_OK) {
fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res));
} else {
std::cout << readBuffer << std::endl;
}
curl_easy_cleanup(curl);
}
return 0;
}成功响应
状态码: 200 OK
响应示例
json
{
"code": 200,
"status": "success",
"message": "返回所属代理线路列表成功",
"meta": {
"has_pages": true,
"total": 2,
"last_page": 2,
"current_page": 1,
"per_page": "1"
},
"data": [
{
"id": "29c39ec4-b292-4af9-a88b-922d61866aag",
"robot_cli_node_id": "2533f3f6-7ac1-4b55-b1de-7d308ce00d89",
"user_id": "88cdf05c-b63a-4b82-a7f1-119a007fa9e2",
"name": "修改线路测试1111",
"description": "400-",
"type": 1,
"call_line": 100,
"call_number_prefix": "",
"origination_caller_id_number": "",
"dial_string": "",
"destination_prefix": "",
"created_at": "2024-09-04 21:24:23",
"updated_at": "2024-09-03 16:55:08",
"bind_type_str": "IP",
"line_allocation": [
{
"id": 11,
"line_id": "29c39ec4-b292-4af9-a88b-922d61866aag",
"belong_user": "b6d94bef-5ac2-4c6e-ba13-d2f8f124862b",
"name": null,
"line_concurrency": 1,
"price": 0,
"begin_at": "2024-11-28 15:32:14",
"deadline_at": "2025-11-28 00:00:00",
"available_time": 31536000,
"created_at": "2024-11-28 15:32:14"
}
]
}
]
}字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
| id | string | 线路 id |
| name | string | 线路名称 |
| user_id | string | 创建用户 id |
| description | string | 备注 |
| type | int | 线路类型【1:外部线路,4:人工线路】 |
| call_line | int | 线路总并发数量 |
| origination_caller_id_number | string | 主叫号码 |
| line_allocation | - | “分配线路”详细信息 |
| line_allocation.belong_user | string | “分配线路”所属用户 id |
| line_allocation.line_concurrency | int | “分配线路”总量并发 |
| line_allocation.price | double | “分配线路”终端价格 |
| line_allocation.begin_at | string | “分配线路”开始时间 |
| line_allocation.deadline_at | string | “分配线路”截至日期 |
| line_allocation.available_time | int | “分配线路”可使用时长 |