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",
           "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"
Go
package main

import (
    "fmt"
    "io"
    "net/http"
)

func main() {
    client := &http.Client{}
    req, _ := http.NewRequest("GET", "https://ai.api.longlonglong.cn/agent-api/user/40863af8-db4a-41c6-a269-eb5bc386d97f/customer_to_task/9403d985-c506-42e4-a189-8a0f715410e8", 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 response = await fetch("https://ai.api.longlonglong.cn/agent-api/user/40863af8-db4a-41c6-a269-eb5bc386d97f/customer_to_task/9403d985-c506-42e4-a189-8a0f715410e8", {
    method: "GET",
    headers: {
        "Content-Type": "application/json",
        "Authorization": "Bearer YOUR_TOKEN"
    }
});
const data = await response.json();
console.log(data);
Java
import java.net.HttpURLConnection;
import java.net.URL;
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws Exception {
        URL url = new URL("https://ai.api.longlonglong.cn/agent-api/user/40863af8-db4a-41c6-a269-eb5bc386d97f/customer_to_task/9403d985-c506-42e4-a189-8a0f715410e8");
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
        conn.setRequestMethod("GET");
        conn.setRequestProperty("Content-Type", "application/json");
        conn.setRequestProperty("Authorization", "Bearer YOUR_TOKEN");
        BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()));
        String line;
        StringBuilder response = new StringBuilder();
        while ((line = br.readLine()) != null) {
            response.append(line);
        }
        br.close();
        System.out.println(response.toString());
    }
}
PHP
<?php
$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_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"
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer YOUR_TOKEN"
}
response = requests.get(url, headers=headers)
print(response.json())
C++
#include <iostream>
#include <curl/curl.h>

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");
        curl_easy_setopt(curl, CURLOPT_URL, "https://ai.api.longlonglong.cn/agent-api/user/40863af8-db4a-41c6-a269-eb5bc386d97f/customer_to_task/9403d985-c506-42e4-a189-8a0f715410e8");
        curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
        CURLcode res = curl_easy_perform(curl);
        curl_easy_cleanup(curl);
    }
    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 许可发布