Appearance
号码详情
接口信息
- 接口:
/agent-api/user/{user_id}/task/{task_id}/number/detail/{phone} - 请求方式:
GET
路由参数
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
| id | string | Y | 账号 ID |
| task_id | string | Y | 任务 ID |
| phone | string | Y | 手机号码 |
请求参数
| 参数 | 类型 | 示例 | 解释 | 必填 |
|---|---|---|---|---|
| encryption | bool | FALSE | 是否加密号码(开启接口加密后有效) | 否 |
| sub_user_id | string | dc53e7e7-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 | 用户屏蔽 |