Appearance
通话列表
接口信息
- 接口:
/agent-api/user/{id}/task/{task_id}/record - 请求方式:
GET
请求说明
注意
原请求地址为GET /agent-api/task/{task_id}/record,新增参数用户id,且为必填 如果仍使用老版本的接口,将使用系统默认的云节点ID,无法操作其他云节点的数据 老版接口将于2023年2月1日下线,请尽快进行更换
请求参数
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
| id | string | Y | 账号 ID |
| task_id | string | Y | 任务 ID |
| levels | array | N | 评分区间 (注意是二维数组) |
| keyword | string | N | 被叫号码 |
| start_at | string | N | 开始时间 |
| end_at | string | N | 结束时间 |
| intention_tags | array | N | 意向标签等级 1A、2B、3C、4D、5E |
| hangup_date | array | N | 挂断时间 |
| page | int | N | 页码 |
| per_page | int | N | 页容量 |
| sub_user_id | string | N | 子账户 id(传递此参数则是对子账户操作) |
请求示例
cURL
curl -X GET "https://ai.api.longlonglong.cn/agent-api/user/4d99d91c-f5d9-49da-88da-758977cc58a9/task/287e19c4-1966-49d6-8f02-b53ef11c0a55/record?page=1&keyword=18555525545" \
-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/user/4d99d91c-f5d9-49da-88da-758977cc58a9/task/287e19c4-1966-49d6-8f02-b53ef11c0a55/record?page=1&keyword=18555525545", 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');
const response = await axios.get(
'https://ai.api.longlonglong.cn/agent-api/user/4d99d91c-f5d9-49da-88da-758977cc58a9/task/287e19c4-1966-49d6-8f02-b53ef11c0a55/record',
{
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
},
params: {
page: 1,
keyword: '18555525545'
}
}
);
console.log(response.data);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/user/4d99d91c-f5d9-49da-88da-758977cc58a9/task/287e19c4-1966-49d6-8f02-b53ef11c0a55/record?page=1&keyword=18555525545"))
.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
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://ai.api.longlonglong.cn/agent-api/user/4d99d91c-f5d9-49da-88da-758977cc58a9/task/287e19c4-1966-49d6-8f02-b53ef11c0a55/record?page=1&keyword=18555525545',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'Authorization: Bearer YOUR_TOKEN'
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;Python
import requests
url = 'https://ai.api.longlonglong.cn/agent-api/user/4d99d91c-f5d9-49da-88da-758977cc58a9/task/287e19c4-1966-49d6-8f02-b53ef11c0a55/record'
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
}
params = {
'page': 1,
'keyword': '18555525545'
}
response = requests.get(url, headers=headers, params=params)
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) {
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, "https://ai.api.longlonglong.cn/agent-api/user/4d99d91c-f5d9-49da-88da-758977cc58a9/task/287e19c4-1966-49d6-8f02-b53ef11c0a55/record?page=1&keyword=18555525545");
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;
}成功响应
条件:任务存在,且各项资源也存在(如转接组ID)。
状态码:200 OK
响应示例:
json
{
"code": 200,
"status": "success",
"message": "查看通话记录列表成功",
"meta": {
"has_pages": true,
"total": 29,
"last_page": 29,
"current_page": 1,
"per_page": "1"
},
"data": [
{
"tags": [
{
"id": "41af0088-7fd1-478b-9e3f-d76213dc552f",
"name": "是谁",
"description": "是谁",
"color": "#2d8cf0",
"user_id": "4d99d91c-f5d9-49da-88da-758977cc58a9",
"status": 1,
"created_at": "2022-08-04 10:32:49",
"updated_at": "2022-08-04 10:32:49",
"pivot": {
"taggable_id": "bb6779df-a2f0-45bc-b76a-f4c8c5b4e5ef",
"tag_id": "41af0088-7fd1-478b-9e3f-d76213dc552f",
"taggable_type": "App\\Models\\AutoDialer\\CallRecordDetail",
"created_at": "2024-09-15 10:14:51",
"updated_at": null
},
"tag_groups": [
{
"id": "c3e29b29-4aa7-4212-bc1f-d694dbf0df42",
"user_id": "40863af8-db4a-41c6-a269-eb5bc386d97f",
"name": "业务相关",
"created_at": "2023-07-27 20:41:38",
"updated_at": "2023-07-27 20:41:38",
"tag_scene_id": "6734fb9c-a648-4304-b76a-cafa6850a24b",
"sort": 0,
"pivot": {
"tag_id": "41af0088-7fd1-478b-9e3f-d76213dc552f",
"tag_group_id": "c3e29b29-4aa7-4212-bc1f-d694dbf0df42",
"created_at": "2023-07-27 20:41:38",
"updated_at": "2023-07-27 20:41:38"
}
}
]
}
],
"tag_groups": [
{
"id": "8a4f4c04-53f6-4a64-92f0-432de9cbcd0a",
"user_id": "4d99d91c-f5d9-49da-88da-758977cc58a9",
"name": "否定",
"created_at": "2024-08-29 21:39:57",
"updated_at": "2024-08-29 21:39:57",
"tag_scene_id": "908c3375-23a3-446e-ab58-b2b0cea0eff7",
"sort": 0,
"pivot": {
"tag_id": "0dd151b3-c6c0-4656-aff7-8cefa06acecc",
"tag_group_id": "8a4f4c04-53f6-4a64-92f0-432de9cbcd0a",
"created_at": "2024-08-29 21:39:57",
"updated_at": "2024-08-29 21:39:57"
}
}
],
"llm_tags": [
{
"id": 1854,
"name": "礼貌"
},
{
"id": 3927,
"name": "敷衍"
},
{
"id": 10433,
"name": "有时间"
},
{
"id": 23126,
"name": "拒加微"
}
],
"operator_name": "联通",
"extra": null,
"name": "测试掉保时间1",
"company": "诡事屋剧本推理社",
"send_wechat_data": [],
"components": [
{
"id": "733b8535-a1f9-4db9-9945-98a2a0c5490e",
"name": "微信",
"type": "text",
"value": "17710726421"
}
],
"comments": [
{
"id": 182,
"record_id": "f2d5827c-dfa8-4b9f-9a6f-29961ef110cd",
"user_id": "5b5cddd5-7635-4950-befe-a4bb9d252611",
"content": "备注信息1",
"created_at": "2026-02-04T05:22:26.000000Z",
"user_name": "测试用户"
},
{
"id": 183,
"record_id": "f2d5827c-dfa8-4b9f-9a6f-29961ef110cd",
"user_id": "5b5cddd5-7635-4950-befe-a4bb9d252611",
"content": "备注信息2",
"created_at": "2026-02-04T05:22:28.000000Z",
"user_name": "测试用户"
}
],
"id": "50971322-2e84-4701-836c-fd1181306885",
"task_id": "287e19c4-1966-49d6-8f02-b53ef11c0a55",
"group_id": 8888,
"callid": "ed26665c-873f-4917-a346-ce38cd2be7b5",
"score": 1000,
"callee": "18555525545",
"caller_number": "0000000000",
"duration": 39500,
"error_code": 0,
"gender": 2,
"level_id": "23059613-da4c-4e52-94e1-42e3a5c0c40d",
"calldate": "2022-09-29 15:09:13",
"bill": 37140,
"hangupcause": "NORMAL_CLEARING",
"hangupdate": "2022-09-29 15:09:53",
"answerdate": "2022-09-29 15:09:16",
"bridge_callid": null,
"bridge_number": null,
"bridge_calldate": null,
"bridge_answerdate": null,
"hangup_disposition": 2,
"created_at": "2022-09-29 15:09:19",
"updated_at": "2022-10-19 14:56:42",
"rounds": 2,
"level_name": "A类客户()",
"read_at": "2022-10-19 14:56:42",
"province_id": 5,
"city_id": 90,
"operator": 2,
"customer_id": "e973e23f-32da-44ea-921a-1988d2c5c7f2",
"user_id": "4d99d91c-f5d9-49da-88da-758977cc58a9",
"processed_at": null,
"number_created_at": "2022-08-02 16:10:48",
"intention_results": 1,
"level": null,
"gender_str": "男",
"hangup_disposition_str": "客户",
"details": [
{
"id": "0c6a21f9-404c-4bd7-be04-35b0baca0b41",
"record_id": "50971322-2e84-4701-836c-fd1181306885",
"task_id": "287e19c4-1966-49d6-8f02-b53ef11c0a55",
"notify": "asrprogress_notify",
"callid": "ed26665c-873f-4917-a346-ce38cd2be7b5",
"error_code": 0,
"asrtype": "aliyunv2",
"callee": "18555525545",
"gender": 0,
"asr_elapse": 544,
"record_ms": 1250,
"volume_gain": 4.2693159999999999,
"question": "挂了吧。",
"split_question": null,
"question_index": 9,
"speak_ms": 0,
"play_ms": 4900,
"keyword": null,
"answer_id": null,
"answer_text": null,
"answer_content": null,
"word_class": null,
"answer_action": null,
"playback_after_action": 0,
"upstream_answer_action": null,
"upstream_answer_content": null,
"upstream_answer_text": null,
"upstream_answer_id": null,
"score": 0,
"sequence": 11,
"created_at": "2022-09-29 15:09:44",
"updated_at": "2022-09-29 15:09:44",
"bridge_status": 0,
"user_id": "4d99d91c-f5d9-49da-88da-758977cc58a9",
"is_regular": 0,
"expression": null,
"tags": []
}
],
"province": {
"id": 5,
"pid": null,
"city": "安徽",
"area_code": "0551",
"post_code": "238000",
"created_at": "2021-04-21 10:20:33",
"updated_at": "2021-04-21 10:20:33"
},
"city": {
"id": 90,
"pid": 5,
"city": "蚌埠",
"area_code": "0552",
"post_code": "233000",
"created_at": "2021-04-21 10:20:33",
"updated_at": "2021-04-21 10:20:33"
}
}
]
}响应参数
| 参数 | 类型 | 描述 |
|---|---|---|
| tags | array | 标签 |
| tag_groups | array | 母标签 |
| llm_tags | array | 大模型标签 |
| operator_name | string | 运营商 |
| extra | string | 额外数据,可用于标识第三方数据 |
| name | string | 客户姓名 |
| company | string | 公司 |
| send_wechat_data | array | 推送微信人员数据 |
| components | array | CRM组件信息 |
| comments | array | 通话备注信息 |
| id | string | id |
| task_id | string | 任务id |
| group_id | int | 话数组id |
| callid | string | 呼叫id |
| score | int | 通话得分 |
| callee | string | 被叫号码 |
| caller_number | string | 主叫号码(注意:不是客户真正接听的号码) |
| duration | int | 外呼时长(毫秒) |
| error_code | int | 错误码(暂时无用) |
| gender | int | 性别 |
| level_id | string | 通话质量id |
| calldate | string | 呼叫时间 |
| bill | int | 接听时长(毫秒) |
| hangupcause | string | 挂断原因(通信层面,没有使用价值) |
| hangupdate | string | 挂断时间 |
| answerdate | string | 接听时间 |
| bridge_callid | string | 转接呼叫id |
| bridge_number | string | 转接号码 |
| bridge_calldate | string | 转接时间 |
| bridge_answerdate | string | 转接接听时间 |
| hangup_disposition | int | 挂断方1AI、2客户 |
| created_at | string | 创建时间 |
| updated_at | string | 更新时间 |
| rounds | int | 交互轮数 |
| level_name | string | 通话质量名称 |
| read_at | string | 查看时间 |
| province_id | int | 省份id |
| city_id | int | 城市id |
| operator | int | 运营商:1电信、2联通、3移动 |
| customer_id | string | CRM公海ID |
| user_id | string | 用户id |
| processed_at | string | 处理时间 |
| number_created_at | string | CRM公海号码创建时间 |
| intention_results | int | 意向标签1A、2B、3C、4D、5E |
| level | object | 通话质量 |
| gender_str | string | 性别 |
| hangup_disposition_str | string | 挂断方 |
| details | array | 通话详情 |
| province | object | 省份 |
| city | object | 城市 |
错误响应
错误1
条件:任务ID不存在。
状态码:200 OK
json
{
"code": 5002,
"status": "error",
"message": "任务不存在",
"data": []
}错误2
条件:账号ID错误,云节点不存在。
状态码:200 OK
json
{
"code": 1002,
"status": "error",
"message": "【user】参数错误,未找到对应云节点",
"data": []
}