Skip to content

呼叫时间组-列表

此接口【v1.2.31版本新增】 查看变更日志

请求信息

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

路由参数

参数类型示例解释必填
user_idstring5832d184-dd53-42a0-8ace-0bf8d660f4cc用户id

请求参数

参数类型示例解释必填
pageint1页码否,不传则为不分页的数据
sub_user_idstringdc53e7e7-3a68-40ae-adfe-63fc00e401d3子账户id

请求示例

cURL
curl -X GET "https://ai.api.longlonglong.cn/agent-api/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/dial-time-group?page=1" \
  -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/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/dial-time-group?page=1"

    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/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/dial-time-group?page=1', {
    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/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/dial-time-group?page=1";

        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/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/dial-time-group?page=1';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
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/5832d184-dd53-42a0-8ace-0bf8d660f4cc/dial-time-group?page=1'

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/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/dial-time-group?page=1");
        curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET");

        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": "查看呼叫时间组列表成功",
    "data": [
        {
            "id": 1,
            "name": "周末拨打组",
            "user_id": "4d99d91c-f5d9-49da-88da-758977cc58a9",
            "content": [
                {
                    "week": 0, // 取值范围为0~6  0对应周日、1对应周一以此类推
                    "times": [ //具体时间段,可设置多个,取值范围为08:00~22:00
                        { 
                            "begin_time": "08:00",
                            "end_time": "20:00"
                        },
                        {
                            "begin_time": "20:30",
                            "end_time": "22:00"
                        }
                    ]
                },
                {
                    "week": 6, //周六
                    "times": [
                        {
                            "begin_time": "08:00",
                            "end_time": "12:00"
                        },
                        {
                            "begin_time": "20:30",
                            "end_time": "22:00"                    
                        }
                    ]
                }
            ],
            "is_default": false, //是否默认
            "skip_holiday": true, //是否跳过节假日
            "remark": null,
            "created_at": "2021-12-30 17:03:32",
            "updated_at": "2022-01-12 17:32:48",
            "tasks": [ //已关联的任务, 已关联任务的呼叫组不可删除
                {
                    "name": "代理测试任务名11",
                    "dial_time_id": 1
                },
                {
                    "name": "代理测试任务名3",
                    "dial_time_id": 1
                }
            ]
        }
    ],
    "meta": { // 分页详情
        "has_pages": false, // 是否需要分页
        "total": 3, // 共多少项
        "last_page": 1, // 最后页码
        "current_page": 1, // 当前页码
        "per_page": 15 // 页容量
    }
}

基于 MIT 许可发布