Appearance
转接组列表
请求信息
- 接口:
/agent-api/bridge_group/{user_id} - 请求方式:
GET
路由参数
| 参数 | 类型 | 示例 | 解释 | 必填 |
|---|---|---|---|---|
| user_id | string | 4d99d91c-f5d9-49da-88da-758977cc58a9 | 用户id | 是 |
请求参数
| 参数 | 类型 | 示例 | 解释 | 必填 |
|---|---|---|---|---|
| page | int | 1 | 页码 | 是 |
请求示例
cURL
curl -X GET "https://ai.api.longlonglong.cn/agent-api/bridge_group/4d99d91c-f5d9-49da-88da-758977cc58a9" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"Go
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
url := "https://ai.api.longlonglong.cn/agent-api/bridge_group/4d99d91c-f5d9-49da-88da-758977cc58a9"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}JavaScript
const axios = require('axios');
axios.get('https://ai.api.longlonglong.cn/agent-api/bridge_group/4d99d91c-f5d9-49da-88da-758977cc58a9', {
headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer YOUR_TOKEN' }
}).then(response => { console.log(response.data); }).catch(error => { console.error('Error:', error); });Java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String url = "https://ai.api.longlonglong.cn/agent-api/bridge_group/4d99d91c-f5d9-49da-88da-758977cc58a9";
HttpRequest request = HttpRequest.newBuilder().uri(URI.create(url))
.header("Content-Type", "application/json").header("Authorization", "Bearer YOUR_TOKEN").GET().build();
HttpClient client = HttpClient.newHttpClient();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}PHP
<?php
$url = 'https://ai.api.longlonglong.cn/agent-api/bridge_group/4d99d91c-f5d9-49da-88da-758977cc58a9';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
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/bridge_group/4d99d91c-f5d9-49da-88da-758977cc58a9'
headers = {'Content-Type': 'application/json', 'Authorization': 'Bearer YOUR_TOKEN'}
response = requests.get(url, headers=headers)
print(response.json())C++
#include <iostream>
#include <string>
#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) {
curl_easy_setopt(curl, CURLOPT_URL, "https://ai.api.longlonglong.cn/agent-api/bridge_group/4d99d91c-f5d9-49da-88da-758977cc58a9");
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_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;
}返回结果
json
{
"code": 200,
"status": "success",
"message": "查看转接组成功",
"meta": {
"has_pages": false,
"total": 2,
"last_page": 1,
"current_page": 1,
"per_page": 15
},
"data": [
{
"id": 4,
"name": "转接组14号",
"caller_line_id": "a3b1db23-67ba-4796-9b2b-ebccb70975f0",
"user_id": "f00c8abc-433f-4666-a9d6-70479605ced1",
"strategy": 2,
"created_at": "2020-12-28 16:38:45",
"updated_at": "2020-12-31 14:10:37",
"strategy_str": "顺序",
"caller_line": {
"id": "a3b1db23-67ba-4796-9b2b-ebccb70975f0",
"name": "银河zq"
},
"employees": [
{
"id": 2,
"name": "我是转接人2号",
"phone": "18361206976",
"pivot": {
"bridge_group_id": 4,
"employee_id": 2,
"sort": 0,
"created_at": "2020-12-31 14:11:52",
"updated_at": "2020-12-31 14:11:52"
}
}
]
},
{
"id": 3,
"name": "转接组2号",
"caller_line_id": "a3b1db23-67ba-4796-9b2b-ebccb70975f0",
"user_id": "f00c8abc-433f-4666-a9d6-70479605ced1",
"strategy": 2,
"created_at": "2020-12-28 16:38:14",
"updated_at": "2020-12-28 17:04:41",
"strategy_str": "顺序",
"caller_line": {
"id": "a3b1db23-67ba-4796-9b2b-ebccb70975f0",
"name": "银河zq"
},
"employees": [
{
"id": 2,
"name": "我是转接人2号",
"phone": "18361206976",
"pivot": {
"bridge_group_id": 3,
"employee_id": 2,
"sort": 0,
"created_at": "2020-12-28 17:04:41",
"updated_at": "2020-12-28 17:04:41"
}
}
]
}
]
}
- 字段解释:
- caller_line 转接组所使用的转接线路
- strategy 该转接组下对转接人所使用的转接策略, 1代表平均,2代表顺序,3代表随机
- employees 代表的是该转接组下面的转接人
- phone 代表转接人的号码