Skip to content

号码详情

接口信息

  • 接口: /agent-api/user/{user_id}/task/{task_id}/number/detail/{phone}
  • 请求方式: GET

路由参数

参数类型必填描述
idstringY账号 ID
task_idstringY任务 ID
phonestringY手机号码

请求参数

参数类型示例解释必填
encryptionboolFALSE是否加密号码(开启接口加密后有效)
sub_user_idstringdc53e7e7-3a68-40ae-adfe-63fc00e401d3子账户 id

请求示例

cURL
curl -X GET "https://ai.api.longlonglong.cn/agent-api/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/task/f232d184-dd54-42a0-8ace-0bf8d660f4cc/number/detail/18651683344?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/detail/18651683344?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/detail/18651683344?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/detail/18651683344?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/detail/18651683344?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/detail/18651683344"
params = {
    "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/detail/18651683344?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": { // 号码详情
        "id": 241, // 号码id
        "number": "18651683344", // 号码
        "status_str": "等待呼叫", // 状态
        "callid": null, // 通话id
        "calldate": null, // 呼叫时间
        "bill": null, // 计费时间(毫秒)
        "duration": null, // 拨打时间(毫秒)
        "hangupcause": null, // 挂断原因
        "answerdate": null, // 接听时间
        "status": 0, // 呼叫状态
        "is_blacklist": false, // 是否在黑名单中
        "city": "", // 城市
        "pro": "", // 省份
        "mobile_type": null, // 运营商
        "area_code": null, // 区号
        "post_code": null // 邮编
    }
}

status 呼叫状态说明

说明
0等待呼叫
1呼叫成功
2运营商拦截
3拒接
4无应答/无人接听
5空号
6关机
7停机
8占线/用户正忙
9呼入限制
10欠费
11黑名单
12用户屏蔽

基于 MIT 许可发布