Skip to content

子账户列表

接口信息

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

路由参数

参数类型示例解释必填
user_idstring5433b412-07d5-44e6-9fa4-deb65e43bc93用户 id

请求参数

参数类型示例解释必填
pageint1页码
per_pageint15每页数量
idstringb3248eaa-c932-4727-b1e9-f99c51d59cb4子账号 id
namestring测试账号用户名
emailstring123456@qq.com邮箱
phonestring123456789手机号码

请求示例

cURL
curl -X GET "https://api.wolfsmartcloud.com/agent-api/user/5433b412-07d5-44e6-9fa4-deb65e43bc93/subset_users?page=1&per_page=15&id=b3248eaa-c932-4727-b1e9-f99c51d59cb4&name=%E6%B5%8B%E8%AF%95%E8%B4%A6%E5%8F%B7&email=123456%40qq.com&phone=123456789" \
  -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/user/5433b412-07d5-44e6-9fa4-deb65e43bc93/subset_users?page=1&per_page=15&id=b3248eaa-c932-4727-b1e9-f99c51d59cb4&name=%E6%B5%8B%E8%AF%95%E8%B4%A6%E5%8F%B7&email=123456%40qq.com&phone=123456789"

    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 userId = "5433b412-07d5-44e6-9fa4-deb65e43bc93";
const params = new URLSearchParams({
  page: 1,
  per_page: 15,
  id: "b3248eaa-c932-4727-b1e9-f99c51d59cb4",
  name: "测试账号",
  email: "123456@qq.com",
  phone: "123456789"
});
const url = `https://api.wolfsmartcloud.com/agent-api/user/${userId}/subset_users?${params}`;

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;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;

public class Main {
    public static void main(String[] args) throws IOException, InterruptedException {
        HttpClient client = HttpClient.newHttpClient();
        String params = "page=1&per_page=15&id=b3248eaa-c932-4727-b1e9-f99c51d59cb4&name=" +
            URLEncoder.encode("测试账号", StandardCharsets.UTF_8) +
            "&email=123456%40qq.com&phone=123456789";
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://api.wolfsmartcloud.com/agent-api/user/5433b412-07d5-44e6-9fa4-deb65e43bc93/subset_users?" + params))
            .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();

$params = http_build_query([
    "page" => 1,
    "per_page" => 15,
    "id" => "b3248eaa-c932-4727-b1e9-f99c51d59cb4",
    "name" => "测试账号",
    "email" => "123456@qq.com",
    "phone" => "123456789"
]);

curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.wolfsmartcloud.com/agent-api/user/5433b412-07d5-44e6-9fa4-deb65e43bc93/subset_users?" . $params,
    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

user_id = "5433b412-07d5-44e6-9fa4-deb65e43bc93"
url = f"https://api.wolfsmartcloud.com/agent-api/user/{user_id}/subset_users"

params = {
    "page": 1,
    "per_page": 15,
    "id": "b3248eaa-c932-4727-b1e9-f99c51d59cb4",
    "name": "测试账号",
    "email": "123456@qq.com",
    "phone": "123456789"
}

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

response = requests.get(url, params=params, 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://api.wolfsmartcloud.com/agent-api/user/5433b412-07d5-44e6-9fa4-deb65e43bc93/subset_users?page=1&per_page=15&id=b3248eaa-c932-4727-b1e9-f99c51d59cb4&name=%E6%B5%8B%E8%AF%95%E8%B4%A6%E5%8F%B7&email=123456%40qq.com&phone=123456789");
        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
{
    "code": 200,
    "status": "success",
    "message": "查看子账户列表成功",
    "data": [
        {
            "id": "91f9254f-ca58-49af-be34-8370d7549d73",
            "name": "子账户1",
            "phone": "123456789",
            "email": "123456789@qq.com",
            "sex": 0,
            "alias": "账户1",
            "duty": "员工",
            "landline_phone": null,
            "qq": null,
            "wechat": null,
            "birthday": "2022-07-13",
            "department": "部门",
            "created_at": "2022-07-13 17:12:37",
            "updated_at": "2022-07-13 17:58:42"
        }
    ],
    "meta": {
        "has_pages": false,
        "total": 5,
        "last_page": 1,
        "current_page": 1,
        "per_page": 15
    }
}

字段说明

字段说明
id子账户ID
name子账户名称
phone手机号码
email邮箱
sex性别:0-未知,1-男,2-女
alias别名
duty职位
landline_phone座机
qqQQ号
wechat微信
birthday生日
department部门
created_at创建时间
updated_at修改时间

基于 MIT 许可发布