Appearance
客户公海(线索阶段)筛选
接口信息
- 接口:
/agent-api/user/{user_id}/type/{type}/get_customer - 请求方式:
GET
路由参数
| 参数 | 类型 | 示例 | 解释 | 必填 |
|---|---|---|---|---|
| user_id | string | 40863af8-db4a-41c6-a269-eb5bc386d97f | 用户 id | 是 |
| type | string | clue | 客户公海阶段类型 | 是 |
请求参数
| 参数 | 类型 | 示例 | 解释 | 必填 |
|---|---|---|---|---|
| page | int | 1 | 分页 | 是 |
| per_page | int | 默认为 15 | 分页数量 | 否 |
| components | array | [] | 客户公海组件信息 | 否 |
| phone | string | "9999999" | 手机号码 可开启加密 | 否 |
| string | 123456@qq.com | 邮箱 | 否 | |
| company | string | xxx 公司 | 公司 | 否 |
| created_at | array | ["2023-03-23 14:00:00", "2023-03-23 14:30:00"] | 号码创建时间 | 否 |
| operator | array | [1] | 号码运营商(1 代表电信,2 代表联通,3 代表移动) | 否 |
| encryption | bool | FALSE | 是否加密号码(开启接口加密后有效) | 否 |
| sex | array | [1] | 性别 (0 未知 1 男 2 女) | 否 |
| is_follow | int | 1 | 跟进状态 (0 代表未跟进 1 代表跟进中) | 否 |
| ai_call | int | 1 | ai 通话记录 (0 代表无 1 代表有) | 否 |
请求示例
cURL
curl -X GET "https://ai.api.longlonglong.cn/agent-api/user/40863af8-db4a-41c6-a269-eb5bc386d97f/type/clue/get_customer?page=1&per_page=15" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"Go
package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL := "https://ai.api.longlonglong.cn/agent-api/user/40863af8-db4a-41c6-a269-eb5bc386d97f/type/clue/get_customer"
params := url.Values{}
params.Add("page", "1")
params.Add("per_page", "15")
fullURL := baseURL + "?" + params.Encode()
client := &http.Client{}
req, _ := http.NewRequest("GET", fullURL, nil)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Bearer YOUR_TOKEN")
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}JavaScript
const userId = "40863af8-db4a-41c6-a269-eb5bc386d97f";
const type = "clue";
const params = new URLSearchParams({
page: 1,
per_page: 15
});
const url = `https://ai.api.longlonglong.cn/agent-api/user/${userId}/type/${type}/get_customer?${params}`;
const response = await fetch(url, {
method: "GET",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_TOKEN"
}
});
const data = await response.json();
console.log(data);Java
import java.net.URI;
import java.net.http.*;
import java.io.IOException;
public class Main {
public static void main(String[] args) throws IOException, InterruptedException {
String baseUrl = "https://ai.api.longlonglong.cn/agent-api/user/40863af8-db4a-41c6-a269-eb5bc386d97f/type/clue/get_customer";
String params = "page=1&per_page=15";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(baseUrl + "?" + params))
.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
$userId = "40863af8-db4a-41c6-a269-eb5bc386d97f";
$type = "clue";
$params = http_build_query([
'page' => 1,
'per_page' => 15
]);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://ai.api.longlonglong.cn/agent-api/user/{$userId}/type/{$type}/get_customer?{$params}");
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
user_id = "40863af8-db4a-41c6-a269-eb5bc386d97f"
type_value = "clue"
url = f"https://ai.api.longlonglong.cn/agent-api/user/{user_id}/type/{type_value}/get_customer"
params = {
"page": 1,
"per_page": 15
}
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_TOKEN"
}
response = requests.get(url, params=params, headers=headers)
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");
std::string url = "https://ai.api.longlonglong.cn/agent-api/user/40863af8-db4a-41c6-a269-eb5bc386d97f/type/clue/get_customer?page=1&per_page=15";
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
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;
}说明
components中的id为组件的id,value为对应的值,值可以去获取公海模板的接口中获取
返回示例
json
{
"code": 200,
"status": "success",
"message": "筛选客户公海列表成功",
"meta": {
"has_pages": false,
"total": 1,
"last_page": 1,
"current_page": 1,
"per_page": 15
},
"data": [
{
"id": "4d2e14b2-cc57-48ae-97d7-15d3b6fd0181",
"phone": "9999999",
"email": "123456@qq.com",
"name": "金山上",
"created_at": "2023-03-23 14:18:01"
}
]
}