Skip to content

客户公海(线索阶段)筛选

请求信息

  • 接口: /agent-api/user/{user_id}/type/{type}/get_customer
  • 请求方式: GET

路由参数

参数类型示例解释必填
user_idstring40863af8-db4a-41c6-a269-eb5bc386d97f用户 id
typestringclue客户公海阶段类型

请求参数

参数类型示例解释必填
pageint1分页
per_pageint默认为 15分页数量
componentsarray[]客户公海组件信息
phonestring"9999999"手机号码 可开启加密
emailstring123456@qq.com邮箱
companystringxxx 公司公司
created_atarray["2023-03-23 14:00:00", "2023-03-23 14:30:00"]号码创建时间
operatorarray[1]号码运营商(1 代表电信,2 代表联通,3 代表移动)
encryptionboolFALSE是否加密号码(开启接口加密后有效)
sexarray[1]性别 (0 未知 1 男 2 女)
is_followint1跟进状态 (0 代表未跟进 1 代表跟进中)
ai_callint1ai 通话记录 (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_back0-新线索 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运营商名称

基于 MIT 许可发布