Skip to content

客户公海筛选进入任务

请求信息

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

路由参数

参数类型示例解释必填
user_idstring40863af8-db4a-41c6-a269-eb5bc386d97f用户 id
task_idstring9403d985-c506-42e4-a189-8a0f715410e8任务 id

请求参数

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

请求示例

json
{
   "components": [
       {
           "id": "280f5b43-0777-479d-b735-7270790aee92",  //客户公海模板的ID
           "value": "腾讯"                                //客户公海模板的值
       }
   ],
   "phone": "13012121212",
   "created_at": ["2021-06-30 13:20:28", "2021-06-30 13:25:28"],
   "operator": [1]
}
cURL
curl -X GET "https://ai.api.longlonglong.cn/agent-api/user/40863af8-db4a-41c6-a269-eb5bc386d97f/customer_to_task/9403d985-c506-42e4-a189-8a0f715410e8" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "components": [
        {
            "id": "280f5b43-0777-479d-b735-7270790aee92",
            "value": "腾讯"
        }
    ],
    "phone": "13012121212",
    "created_at": ["2021-06-30 13:20:28", "2021-06-30 13:25:28"],
    "operator": [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/customer_to_task/9403d985-c506-42e4-a189-8a0f715410e8"

    // 请求体 JSON
    body := `{
        "components": [
            {
                "id": "280f5b43-0777-479d-b735-7270790aee92",
                "value": "腾讯"
            }
        ],
        "phone": "13012121212",
        "created_at": ["2021-06-30 13:20:28", "2021-06-30 13:25:28"],
        "operator": [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 url = "https://ai.api.longlonglong.cn/agent-api/user/40863af8-db4a-41c6-a269-eb5bc386d97f/customer_to_task/9403d985-c506-42e4-a189-8a0f715410e8";

// 请求体 JSON
const bodyObj = {
    components: [
        {
            id: "280f5b43-0777-479d-b735-7270790aee92",
            value: "腾讯"
        }
    ],
    phone: "13012121212",
    created_at: ["2021-06-30 13:20:28", "2021-06-30 13:25:28"],
    operator: [1]
};

const response = await fetch(url, {
    method: "GET",
    headers: {
        "Content-Type": "application/json",
        "Authorization": "Bearer YOUR_TOKEN"
    },
    body: JSON.stringify(bodyObj)
});
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/customer_to_task/9403d985-c506-42e4-a189-8a0f715410e8";

        // 请求体 JSON
        String body = """
        {
            "components": [
                {
                    "id": "280f5b43-0777-479d-b735-7270790aee92",
                    "value": "腾讯"
                }
            ],
            "phone": "13012121212",
            "created_at": ["2021-06-30 13:20:28", "2021-06-30 13:25:28"],
            "operator": [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(body))
            .build();

        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.body());
    }
}
PHP
<?php

// 请求体 JSON
$body = json_encode([
    'components' => [
        [
            'id' => '280f5b43-0777-479d-b735-7270790aee92',
            'value' => '腾讯'
        ]
    ],
    'phone' => '13012121212',
    'created_at' => ['2021-06-30 13:20:28', '2021-06-30 13:25:28'],
    'operator' => [1]
]);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://ai.api.longlonglong.cn/agent-api/user/40863af8-db4a-41c6-a269-eb5bc386d97f/customer_to_task/9403d985-c506-42e4-a189-8a0f715410e8");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
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/40863af8-db4a-41c6-a269-eb5bc386d97f/customer_to_task/9403d985-c506-42e4-a189-8a0f715410e8"

# 请求体 JSON
body = {
    "components": [
        {
            "id": "280f5b43-0777-479d-b735-7270790aee92",
            "value": "腾讯"
        }
    ],
    "phone": "13012121212",
    "created_at": ["2021-06-30 13:20:28", "2021-06-30 13:25:28"],
    "operator": [1]
}

headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer YOUR_TOKEN"
}

response = requests.get(url, json=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 = 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/customer_to_task/9403d985-c506-42e4-a189-8a0f715410e8";

        // 请求体 JSON
        std::string body = R"({
            "components": [
                {
                    "id": "280f5b43-0777-479d-b735-7270790aee92",
                    "value": "腾讯"
                }
            ],
            "phone": "13012121212",
            "created_at": ["2021-06-30 13:20:28", "2021-06-30 13:25:28"],
            "operator": [1]
        })";

        std::string readBuffer;
        curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
        curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET");
        curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body.c_str());
        curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);

        CURLcode res = curl_easy_perform(curl);
        curl_slist_free_all(headers);
        curl_easy_cleanup(curl);

        std::cout << readBuffer << std::endl;
    }
    return 0;
}

说明

该接口在使用前请先在代理端设置接口"客户公海导入任务回调"的URL,在处理完成后会通过此接口将信息返回给该URL。

components中的id为组件的id,value为对应的值,id的值可以去创建公海模板的接口中获取。

返回示例

json
{
    "code": 200,
    "status": "success",
    "message": "号码导入任务信息请在回调中查收",
    "data": {
        "unique_id": "52732ea0-a1c7-44c6-a709-7dee5070ed7f"
    }
}

字段说明

字段说明
unique_id回调批次号

基于 MIT 许可发布