Appearance
线路消费报表
接口信息
- 接口:
/agent-api/user/{user_id}/call_line_fee - 请求方式:
GET
路由参数
| 参数 | 类型 | 示例 | 解释 | 必填 |
|---|---|---|---|---|
| user_id | string | 5433b412-07d5-44e6-9fa4-deb65e43bc93 | 用户 id | 是 |
请求参数
| 参数 | 类型 | 示例 | 解释 | 必填 |
|---|---|---|---|---|
| date | array | ["2023-05-08", "2023-05-28"] | 日期 | 否(不传递,默认传递近 7 天范围数据) |
| caller_line_ids | array | ['701c4d11-84f3-4471-98ab-34f4f376e449'] | 线路 id | 否(不传递,默认全部选择) |
| type | string | self(self:主账号 | all:主账号以及所有子账号) | |
| task_ids | array | ["9c5f5251-d4fa-4198-91e5-78a2f7356b67"] | 任务 id | 否(不传递,默认全部选择) |
| user_ids | array | ["f4640e36-01a1-4506-a8a5-8b25a81b890c"] | 用户 id | 否(注意:传递该参数,将只会查找传递用户的数据) |
请求示例
cURL
curl -X GET "https://ai.api.longlonglong.cn/agent-api/user/5433b412-07d5-44e6-9fa4-deb65e43bc93/call_line_fee?date[]=2023-05-08&date[]=2023-05-28&type=self" \
-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/5433b412-07d5-44e6-9fa4-deb65e43bc93/call_line_fee?date[]=2023-05-08&date[]=2023-05-28&type=self", 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 response = await fetch("https://ai.api.longlonglong.cn/agent-api/user/5433b412-07d5-44e6-9fa4-deb65e43bc93/call_line_fee?date[]=2023-05-08&date[]=2023-05-28&type=self", {
method: "GET",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_TOKEN"
}
});
const data = await response.json();
console.log(data);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 {
URL url = new URL("https://ai.api.longlonglong.cn/agent-api/user/5433b412-07d5-44e6-9fa4-deb65e43bc93/call_line_fee?date[]=2023-05-08&date[]=2023-05-28&type=self");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
conn.setRequestProperty("Content-Type", "application/json");
conn.setRequestProperty("Authorization", "Bearer YOUR_TOKEN");
BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line;
StringBuilder response = new StringBuilder();
while ((line = br.readLine()) != null) {
response.append(line);
}
br.close();
System.out.println(response.toString());
}
}PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://ai.api.longlonglong.cn/agent-api/user/5433b412-07d5-44e6-9fa4-deb65e43bc93/call_line_fee?date[]=2023-05-08&date[]=2023-05-28&type=self",
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/5433b412-07d5-44e6-9fa4-deb65e43bc93/call_line_fee"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_TOKEN"
}
params = {
"date": ["2023-05-08", "2023-05-28"],
"type": "self"
}
response = requests.get(url, headers=headers, params=params)
print(response.json())C++
#include <iostream>
#include <curl/curl.h>
int main() {
CURL* curl;
CURLcode res;
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/5433b412-07d5-44e6-9fa4-deb65e43bc93/call_line_fee?date[]=2023-05-08&date[]=2023-05-28&type=self");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
return 0;
}返回示例
json
{
"code": 200,
"status": "success",
"message": "查看线路报表成功",
"data": {
"2023-05-20 00:00:00": [
{
"user_id": "073d8501-b6a3-4869-a87e-71807bfd4fb8",
"caller_line_id": "701c4d11-84f3-4471-98ab-34f4f376e449",
"caller_line_name": "测试坐席10006-云节点一",
"caller_number": "0000000000",
"daily_fee": 7,
"duration": 268699,
"call_count": 6,
"date": "2023-05-20 00:00:00"
}
]
}
}