Skip to content

任务初始化

获取新建任务所需要的初始信息

接口信息

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

路由参数

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

请求参数

参数类型示例解释必填
sub_user_idstring5b55bcca-d653-4a58-8f9a-437fb0601f8e子账户 id(传递此参数则是对子账户操作)

请求示例

cURL
curl -X GET "https://api.wolfsmartcloud.com/agent-api/new/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/task/create?sub_user_id=5b55bcca-d653-4a58-8f9a-437fb0601f8e" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN"
Go
package main

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

func main() {
    url := "https://api.wolfsmartcloud.com/agent-api/new/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/task/create?sub_user_id=5b55bcca-d653-4a58-8f9a-437fb0601f8e"

    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');

const userId = "5832d184-dd53-42a0-8ace-0bf8d660f4cc";
const params = new URLSearchParams({
    sub_user_id: "5b55bcca-d653-4a58-8f9a-437fb0601f8e"
});

axios.get(`https://api.wolfsmartcloud.com/agent-api/new/user/${userId}/task/create?${params}`, {
    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://api.wolfsmartcloud.com/agent-api/new/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/task/create?sub_user_id=5b55bcca-d653-4a58-8f9a-437fb0601f8e";

        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

$params = http_build_query([
    'sub_user_id' => '5b55bcca-d653-4a58-8f9a-437fb0601f8e'
]);

$url = 'https://api.wolfsmartcloud.com/agent-api/new/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/task/create?' . $params;

$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://api.wolfsmartcloud.com/agent-api/new/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/task/create'

params = {
    'sub_user_id': '5b55bcca-d653-4a58-8f9a-437fb0601f8e'
}

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

response = requests.get(url, params=params, 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://api.wolfsmartcloud.com/agent-api/new/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/task/create?sub_user_id=5b55bcca-d653-4a58-8f9a-437fb0601f8e");

        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": {
    "task_dial_times": [ //时间组信息
      {
        "id": 1,
        "name": "系统呼叫时间",
        "user_id": "b6d94bef-5ac2-4c6e-ba13-d2f8f124862b", // 用户id
        "content": [
          {
            "week": 0,
            "times": [
              {
                "end_time": "12:00",
                "begin_time": "09:00"
              },
              {
                "end_time": "18:00",
                "begin_time": "13:00"
              }
            ]
          },
          {
            "week": 1,
            "times": [
              {
                "end_time": "12:00",
                "begin_time": "09:00"
              },
              {
                "end_time": "18:00",
                "begin_time": "13:00"
              }
            ]
          },
          {
            "week": 2,
            "times": [
              {
                "end_time": "12:00",
                "begin_time": "09:00"
              },
              {
                "end_time": "18:00",
                "begin_time": "13:00"
              }
            ]
          },
          {
            "week": 3,
            "times": [
              {
                "end_time": "12:00",
                "begin_time": "09:00"
              },
              {
                "end_time": "18:00",
                "begin_time": "13:00"
              }
            ]
          },
          {
            "week": 4,
            "times": [
              {
                "end_time": "12:00",
                "begin_time": "09:00"
              },
              {
                "end_time": "18:00",
                "begin_time": "13:00"
              }
            ]
          },
          {
            "week": 5,
            "times": [
              {
                "end_time": "12:00",
                "begin_time": "09:00"
              },
              {
                "end_time": "18:00",
                "begin_time": "13:00"
              }
            ]
          },
          {
            "week": 6,
            "times": [
              {
                "end_time": "12:00",
                "begin_time": "09:00"
              },
              {
                "end_time": "18:00",
                "begin_time": "13:00"
              }
            ]
          }
        ],
        "is_default": true,
        "remark": null,
        "created_at": "2024-06-16 14:57:12",
        "updated_at": "2024-06-16 14:57:12"
      }
    ],
    "caller_line_list": [ // 当前用户可使用2.0外呼线路信息
      {
        "name": null,
        "remark": "yw代理-测试主账户1", // 线路备注
        "line_id": "29c39ec4-b292-4af9-a88b-922d61866aag", // 线路id
        "belong_user": "b6d94bef-5ac2-4c6e-ba13-d2f8f124862b", // 所属用户
        "line_concurrency": 1,
        "residue": 1,
        "available_at": "2025-11-28 00:00:00",
        "new_line": {
          "name": "修改线路测试1111", // 线路名称
          "type": 1, // 线路类型 
          "bind_type_str": "IP",
          "type_str": "外部线路",
          "usage": 1, //线路用途 1-常规 2-大模型 4-端到端
          "node": {
            "name": "fs-node1" // 节点名称
          }
        }
      }
    ],
    "call_in_line_list": [ //  当前用户可使用呼入线路信息
      {
        "name": null,
        "remark": "root-cbq测试(体育生测试号)",
        "line_id": "f15e465a-50f4-4f5b-8f78-772b539f33a5",
        "belong_user": "b6d94bef-5ac2-4c6e-ba13-d2f8f124862b",
        "line_concurrency": 1,  //线路总量并发数
        "residue": 1, //线路剩余可使用并发数
        "available_at": "2025-03-12 10:09:02",
        "new_line": {
          "name": "呼入测试",
          "type": 2,
          "bind_type_str": "IP",
          "type_str": "内部线路",
          "usage": 1, //线路用途 1-常规 2-大模型 4-端到端
          "node": {
            "name": "节点 1(负载均衡版)"
          }
        }
      }
    ],
    "max_recycle_limit": 50,
    "outbound_group": [ //常规外呼话术组信息
      {
        "id": 1,
        "name": "测试-抖音-1",
        "user_id": "b6d94bef-5ac2-4c6e-ba13-d2f8f124862b",
        "category_id": null,
        "debug": true,
        "deleted_at": null,
        "created_at": "2024-06-17 10:46:03",
        "updated_at": "2024-09-26 18:36:59",
        "link_word_group_id": null,
        "tag_scene_id": null,
        "knowledge_id": null,
        "exclusive_asr": "aliYun1",
        "exclusive_tts": "aliyunv2_siyue",
        "priority_matching": 0,
        "is_top": 0,
        "nlp_threshold": 0,
        "order_matching": 0,
        "sort": 0,
        "usable": 0,
        "inner": 0,
        "is_sync": 0,
        "speed": 50,
        "volume": 50,
        "is_lock": 0,
        "is_train": 0,
        "is_visible": 1,
        "is_edit": 1,
        "is_active": 1,
        "use_type": 3,
        "extension_number": null,
        "aim_content": null,
        "intention_group_id": 0,
        "tts_extension": null,
        "big_model_type": "local_zhipu-api",
        "local_knowledge_base_id": null,
        "custom_prompt": null,
        "bridge_group_id": null,
        "llm_nlp_threshold": 80,
        "llm_scene_id": null,
        "default": false
      }
    ],
    "outbound_group_v2": [ //用户2.0话术信息
      {
        "id": "141116018687787008",
        "name": "11",
        "created_at": "2025-04-25 09:44:40",
        "updated_at": "2025-05-27 18:20:15",
        "variable": []
      },
      {
        "id": "172094106779435008",
        "name": "变量话术测试",
        "created_at": "2025-07-19 21:20:32",
        "updated_at": "2025-07-19 21:27:48",
        "variable": [
          {
            "id": 172135971469836288,
            "name": "自定义变量1",
            "desc": "",
            "type": 1,
            "is_save": false,
            "is_builtin": false,
            "is_fill": true
          },
          {
            "id": 172138979482058752,
            "name": "自定义变量2",
            "desc": "",
            "type": 1,
            "is_save": false,
            "is_builtin": false,
            "is_fill": true
          }
        ]
      },
      {
        "id": "173172648300724225",
        "name": "max-speak-time",
        "created_at": "2025-07-22 20:46:16",
        "updated_at": "2025-07-22 21:07:44",
        "variable": []
      }
    ],
    "big_model_outbound_group": [ // 大模型外呼话术组
      {
        "id": 12542,
        "name": "测试",
        "is_lock": 0,
        "is_active": 1,
        "is_call_in": 0,
        "llm_end_type": 0,
        "created_at": "2025-03-13 17:08:19",
        "default": false
      }
    ],
    "bridge_groups": [ // 转接分组信息
      {
        "id": 1,
        "name": "转人工",
        "strategy": 1,
        "strategy_str": "平均"
      }
    ],
    "auto_recycle_rules": [ // 重呼规则
      {
        "id": 1,
        "user_id": "b6d94bef-5ac2-4c6e-ba13-d2f8f124862b",
        "name": "默认重呼规则",
        "remark": "默认重呼规则",
        "status": true,
        "created_at": "2024-06-16 14:57:12",
        "updated_at": "2024-06-16 14:57:12",
        "is_default": true,
        "type": 1,
        "configs": [],
        "details": [
          {
            "rule_id": 1,
            "number_status": 6,
            "time": 0,
            "number_status_str": "关机"
          }
        ]
      }
    ],
    "end_actions": { // 2.0任务后续动作
      "1": "暂停任务释放并发",
      "0": "无操作"
    },
    "background": [ // 背景音列表
      {
        "id": 34,
        "name": "超市大厅",
        "created_at": "2024-10-25 13:25:43"
      }
    ],
    "llm_intention_configs": [
      {
        "id": 1,
        "name": "质检条件1",
        "user_id": "b6d94bef-5ac2-4c6e-ba13-d2f8f124862b",
        "llm_type": 2,
        "is_default": 0,
        "created_at": "2024-11-19 15:03:46"
      }
    ]
  }
}

字段说明

字段说明
task_dial_times时间组信息
caller_line_list当前用户可使用2.0外呼线路信息
call_in_line_list当前用户可使用呼入线路信息
outbound_group常规外呼话术组信息
outbound_group_v2用户2.0话术信息
big_model_outbound_group大模型外呼话术组
bridge_groups转接分组信息
auto_recycle_rules重呼规则
end_actions2.0任务后续动作
background背景音列表
llm_intention_configs大模型质检配置

基于 MIT 许可发布