Skip to content

查询vos话单列表

请求信息

  • 接口: /agent-api/vos/{user_id}/get_recharge
  • 请求方式: GET

路由参数

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

请求参数

参数类型示例解释必填
timedate"2022-12-01"日期(默认查询前一天数据)
phonestring"123123123"主叫号码
callee_phonestring"56765345"被叫号码
vos_account_idint10vos账号id(不传默认查询第一个账号)

请求示例

cURL
curl -X GET "https://ai.api.longlonglong.cn/agent-api/vos/5832d184-dd53-42a0-8ace-0bf8d660f4cc/get_recharge" \
  -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/vos/5832d184-dd53-42a0-8ace-0bf8d660f4cc/get_recharge"
    req, _ := http.NewRequest("GET", url, nil)
    req.Header.Set("Content-Type", "application/json")
    req.Header.Set("Authorization", "Bearer YOUR_TOKEN")
    client := &http.Client{}
    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/vos/5832d184-dd53-42a0-8ace-0bf8d660f4cc/get_recharge', {
    headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer YOUR_TOKEN' }
}).then(response => { console.log(response.data); }).catch(error => { console.error('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 {
        String url = "https://ai.api.longlonglong.cn/agent-api/vos/5832d184-dd53-42a0-8ace-0bf8d660f4cc/get_recharge";
        HttpRequest request = HttpRequest.newBuilder().uri(URI.create(url))
                .header("Content-Type", "application/json").header("Authorization", "Bearer YOUR_TOKEN").GET().build();
        HttpClient client = HttpClient.newHttpClient();
        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.body());
    }
}
PHP
<?php
$url = 'https://ai.api.longlonglong.cn/agent-api/vos/5832d184-dd53-42a0-8ace-0bf8d660f4cc/get_recharge';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $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/vos/5832d184-dd53-42a0-8ace-0bf8d660f4cc/get_recharge'
headers = {'Content-Type': 'application/json', 'Authorization': 'Bearer YOUR_TOKEN'}
response = requests.get(url, headers=headers)
print(response.json())
C++
#include <iostream>
#include <string>
#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/vos/5832d184-dd53-42a0-8ace-0bf8d660f4cc/get_recharge");
        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);
        curl_slist_free_all(headers); curl_easy_cleanup(curl);
        std::cout << readBuffer << std::endl;
    }
    return 0;
}

返回参数

json
{
    "code": 200,
    "status": "success",
    "message": "查询话单列表成功",
    "data": [
        {
            "phone": "123123123123", // 主叫号码
            "callee_phone": "456456456456", // 被叫号码
            "start_time": "2022-12-15 09:08:44", // 开始时间
            "end_time": "2022-12-15 09:08:44", // 结束时间
            "hold_time": "00:00:00", // 通话时长
            "fee": 0, // 话费
            "call_level_text": "国内长途", // 通话类型
            "customer_name": "vos", // 账号名称
            "customer_account": "12312312" // 账号
        }
    ],
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "http://ai-vos.telrobot.top/api/member/call-record",
        "per_page": 15,
        "to": 2,
        "total": 2
    }
}

基于 MIT 许可发布