Skip to content

客户公海筛选

接口信息

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

路由参数

参数说明
user_id用户ID

请求参数

参数类型示例解释必填
user_idstring5832d184-dd53-42a0-8ace-0bf8d660f4cc用户id
pageint1分页
per_pageint默认为15分页数量
componentsarray[]客户公海组件信息
phonestring"13012121212"手机号码 可开启加密
emailstring123456@qq.com邮箱
companystringxxx公司公司
created_atarray["2021-06-30 13:20:28", "2021-06-30 15:20:28"]号码创建时间
operatorarray[1]号码运营商(1代表电信,2代表联通,3代表移动)
encryptionboolFALSE是否加密号码(开启接口加密后有效)

请求示例

cURL
curl -X GET "https://ai.api.longlonglong.cn/agent-api/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/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/5832d184-dd53-42a0-8ace-0bf8d660f4cc/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 = "5832d184-dd53-42a0-8ace-0bf8d660f4cc";
const params = new URLSearchParams({
    page: 1,
    per_page: 15
});
const url = `https://ai.api.longlonglong.cn/agent-api/user/${userId}/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.URLEncoder;
import java.net.http.*;
import java.nio.charset.StandardCharsets;
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/5832d184-dd53-42a0-8ace-0bf8d660f4cc/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 = "5832d184-dd53-42a0-8ace-0bf8d660f4cc";
$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}/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 = "5832d184-dd53-42a0-8ace-0bf8d660f4cc"
url = f"https://ai.api.longlonglong.cn/agent-api/user/{user_id}/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/5832d184-dd53-42a0-8ace-0bf8d660f4cc/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": 6,
        "last_page": 1,
        "current_page": 1,
        "per_page": 15
    },
    "data": [
        {
          "id": "bb83e44b-5158-47d3-862f-0579e95df0cf",
          "user_id": "f00c8abc-433f-4666-a9d6-70479605ced1",
          "phone": "13012121212",
          "company": "xxx公司",
          "email": "123456@qq.com",
          "sort": 1,
          "created_at": "2021-06-30 13:01:03",
          "updated_at": "2021-06-30 13:29:03",
          "province_id": 465,
          "city_id": 629,
          "operator": 1,
          "extra": null,
          "operator_name": "电信"
        }
    ]
}

基于 MIT 许可发布