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" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
# components 中 id 为客户公海模板的ID,value 为客户公海模板的值
-d '{
"components":[
{
"id":"280f5b43-0777-479d-b735-7270790aee92",
"value":"腾讯"
}
],
"phone":"9999999",
"email":"123456@qq.com",
"created_at":["2023-03-23 14:00:00","2023-03-23 14:30:00"],
"encryption":false,
"sex":[1],
"is_follow":1,
"ai_call":1
}'Go
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
url := "https://ai.api.longlonglong.cn/agent-api/user/40863af8-db4a-41c6-a269-eb5bc386d97f/type/clue/get_customer"
// components 中 id 为客户公海模板的ID,value 为客户公海模板的值
body := `{
"components":[
{
"id":"280f5b43-0777-479d-b735-7270790aee92",
"value":"腾讯"
}
],
"phone":"9999999",
"email":"123456@qq.com",
"created_at":["2023-03-23 14:00:00","2023-03-23 14:30:00"],
"encryption":false,
"sex":[1],
"is_follow":1,
"ai_call":1
}`
client := &http.Client{}
req, _ := http.NewRequest("GET", url, strings.NewReader(body))
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Bearer YOUR_TOKEN")
resp, _ := client.Do(req)
defer resp.Body.Close()
respBody, _ := io.ReadAll(resp.Body)
fmt.Println(string(respBody))
}JavaScript
const userId = "40863af8-db4a-41c6-a269-eb5bc386d97f";
const type = "clue";
const url = `https://ai.api.longlonglong.cn/agent-api/user/${userId}/type/${type}/get_customer`;
const requestBody = {
components: [
{
id: "280f5b43-0777-479d-b735-7270790aee92", //客户公海模板的ID
value: "腾讯" //客户公海模板的值
}
],
phone: "9999999",
email: "123456@qq.com",
created_at: ["2023-03-23 14:00:00", "2023-03-23 14:30:00"],
encryption: false,
sex: [1],
is_follow: 1,
ai_call: 1
};
const response = await fetch(url, {
method: "GET",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_TOKEN"
},
body: JSON.stringify(requestBody)
});
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 url = "https://ai.api.longlonglong.cn/agent-api/user/40863af8-db4a-41c6-a269-eb5bc386d97f/type/clue/get_customer";
// components 中 id 为客户公海模板的ID,value 为客户公海模板的值
String requestBody = """
{
"components":[
{
"id":"280f5b43-0777-479d-b735-7270790aee92",
"value":"腾讯"
}
],
"phone":"9999999",
"email":"123456@qq.com",
"created_at":["2023-03-23 14:00:00","2023-03-23 14:30:00"],
"encryption":false,
"sex":[1],
"is_follow":1,
"ai_call":1
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Content-Type", "application/json")
.header("Authorization", "Bearer YOUR_TOKEN")
.method("GET", HttpRequest.BodyPublishers.ofString(requestBody))
.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";
$requestBody = json_encode([
'components' => [
[
'id' => '280f5b43-0777-479d-b735-7270790aee92', //客户公海模板的ID
'value' => '腾讯' //客户公海模板的值
]
],
'phone' => '9999999',
'email' => '123456@qq.com',
'created_at' => ['2023-03-23 14:00:00', '2023-03-23 14:30:00'],
'encryption' => false,
'sex' => [1],
'is_follow' => 1,
'ai_call' => 1
]);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://ai.api.longlonglong.cn/agent-api/user/{$userId}/type/{$type}/get_customer");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Content-Type: application/json",
"Authorization: Bearer YOUR_TOKEN"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, $requestBody);
$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"
request_body = {
"components": [
{
"id": "280f5b43-0777-479d-b735-7270790aee92", # 客户公海模板的ID
"value": "腾讯" # 客户公海模板的值
}
],
"phone": "9999999",
"email": "123456@qq.com",
"created_at": ["2023-03-23 14:00:00", "2023-03-23 14:30:00"],
"encryption": False,
"sex": [1],
"is_follow": 1,
"ai_call": 1
}
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_TOKEN"
}
response = requests.get(url, json=request_body, 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";
// components 中 id 为客户公海模板的ID,value 为客户公海模板的值
std::string requestBody = R"({
"components":[
{
"id":"280f5b43-0777-479d-b735-7270790aee92",
"value":"腾讯"
}
],
"phone":"9999999",
"email":"123456@qq.com",
"created_at":["2023-03-23 14:00:00","2023-03-23 14:30:00"],
"encryption":false,
"sex":[1],
"is_follow":1,
"ai_call":1
})";
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, requestBody.c_str());
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",
"user_id": "40863af8-db4a-41c6-a269-eb5bc386d97f",
"created_user_id": "40863af8-db4a-41c6-a269-eb5bc386d97f",
"phone": "9999999",
"company": null,
"email": "123456@qq.com",
"is_back": 0,
"source_id": 0,
"industry_id": 0,
"grade_id": 0,
"name": "金山上",
"sort": 102,
"created_at": "2023-03-23 14:18:01",
"updated_at": "2023-04-07 11:27:14",
"inputted_at": "2023-03-23 14:17:22",
"viewed_at": "2023-04-07 11:27:14",
"province_id": 0,
"city_id": 0,
"operator": 0,
"flow": 1,
"extra": null,
"sex": 0,
"expect_transaction_at": null,
"expect_transaction_fee": "0.00",
"unfollow_back_at": null,
"unsettled_back_at": "2023-07-01",
"followed_at": "2023-03-23 14:18:52",
"operator_name": "未知"
}
]
}字段说明
| 字段 | 说明 |
|---|---|
| meta.has_pages | 是否有更多页 |
| meta.total | 总数 |
| meta.last_page | 最后一页 |
| meta.current_page | 当前页 |
| meta.per_page | 每页数量 |
| data.*.id | 客户 id |
| data.*.user_id | 用户 id |
| data.*.phone | 手机号码 |
| data.*.company | 公司 |
| data.*.email | 邮箱 |
| data.*.is_back | 0-新线索 1-退回线索 |
| data.*.source_id | 来源 id |
| data.*.industry_id | 行业 id |
| data.*.grade_id | 等级 id |
| data.*.name | 客户名称 |
| data.*.sort | 排序 |
| data.*.created_at | 创建时间 |
| data.*.updated_at | 更新时间 |
| data.*.inputted_at | 录入时间 |
| data.*.viewed_at | 查看时间 |
| data.*.province_id | 省份 id |
| data.*.city_id | 城市 id |
| data.*.operator | 运营商 (0未知 1电信 2联通 3移动) |
| data.*.flow | 销售阶段 (0公海 1线索 2签约) |
| data.*.extra | 额外数据 |
| data.*.sex | 性别 (0未知 1男 2女) |
| data.*.followed_at | 跟进时间 |
| data.*.operator_name | 运营商名称 |