Skip to content

查看下级用户所有话术

获取伙伴账号下级用户创建的话术

接口信息

  • 接口: /agent-api/agent_group/tenant/{tenant_id}
  • 请求方式: GET

路由参数

参数类型示例解释必填
tenant_idstring5433b412-07d5-44e6-9fa4-deb65e43bc93租户ID(获取方式:云节点列表)

请求示例

cURL
curl -X GET "https://ai.api.longlonglong.cn/agent-api/agent_group/tenant/5433b412-07d5-44e6-9fa4-deb65e43bc93" \
  -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/agent_group/tenant/5433b412-07d5-44e6-9fa4-deb65e43bc93"

    req, _ := http.NewRequest("GET", url, nil)
    req.Header.Set("Content-Type", "application/json")
    req.Header.Set("Authorization", "Bearer YOUR_TOKEN")

    client := &http.Client{}
    resp, _ := client.Do(req)
    defer resp.Body.Close()

    body, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body))
}
JavaScript
const tenantId = "5433b412-07d5-44e6-9fa4-deb65e43bc93";
const url = `https://ai.api.longlonglong.cn/agent-api/agent_group/tenant/${tenantId}`;

fetch(url, {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer YOUR_TOKEN"
  }
})
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error("Error:", error));
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 {
        HttpClient client = HttpClient.newHttpClient();
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://ai.api.longlonglong.cn/agent-api/agent_group/tenant/5433b412-07d5-44e6-9fa4-deb65e43bc93"))
            .header("Content-Type", "application/json")
            .header("Authorization", "Bearer YOUR_TOKEN")
            .GET()
            .build();

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

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "https://ai.api.longlonglong.cn/agent-api/agent_group/tenant/5433b412-07d5-44e6-9fa4-deb65e43bc93",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Content-Type: application/json",
        "Authorization: Bearer YOUR_TOKEN"
    ],
]);

$response = curl_exec($curl);
curl_close($curl);

echo $response;
Python
import requests

tenant_id = "5433b412-07d5-44e6-9fa4-deb65e43bc93"
url = f"https://ai.api.longlonglong.cn/agent-api/agent_group/tenant/{tenant_id}"

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>

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) {
        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/agent_group/tenant/5433b412-07d5-44e6-9fa4-deb65e43bc93");
        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);
        if(res != CURLE_OK)
            fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res));
        else
            std::cout << readBuffer << std::endl;

        curl_easy_cleanup(curl);
    }
    return 0;
}

返回示例

json
{
    "data": [
        {
            "id": 9890,
            "name": "测试11112",
            "user_id": "073d8501-b6a3-4869-a87e-71807bfd4fb8",
            "user": "测试11112/",
            "agent": "云蝠智能",
            "created_at": "2023-09-11 09:41:15"
        },
        {
            "id": 9669,
            "name": "测试8-16",
            "user_id": "773a6f68-851d-4414-87a0-d6b373e1f24a",
            "user": "测试8-16/测试33",
            "agent": "云蝠智能",
            "created_at": "2023-08-16 09:43:31"
        }
    ],
    "links": {
        "first": "http://xxx?page=1",
        "last": "http://xxx?page=22",
        "prev": null,
        "next": "http://xxx?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 22,
        "per_page": "10",
        "to": 10,
        "total": 216
    }
}

字段说明

字段说明
id话术ID
name话术名称
user_id所属用户ID
user所属用户(子账户为 xx/xx)
agent所属代理
created_at创建时间

基于 MIT 许可发布