itecdn 5.x用户文档
itecdn 5.x / 用户 API

查询用户配置列表

GET/v1/user-configs

分页查询用户默认配置。普通用户只能查看自己的配置;管理员可通过 uid 筛选指定用户。可按配置类型、启用状态和配置项名称精确筛选,结果按配置 ID 倒序返回。

身份认证

access-token

api-key + api-secret

认证定义
{
  "AccessToken": {
    "type": "apiKey",
    "in": "header",
    "name": "access-token",
    "description": "通过登录接口获得的短期访问令牌。"
  },
  "ApiKey": {
    "type": "apiKey",
    "in": "header",
    "name": "api-key",
    "description": "API Key;必须和 api-secret 同时发送。"
  },
  "ApiSecret": {
    "type": "apiKey",
    "in": "header",
    "name": "api-secret",
    "description": "API Secret;必须和 api-key 同时发送。"
  }
}

请求参数

参数位置类型必填说明与约束
pagequeryinteger可选

页码,必须为数字;未传时为 1。

完整参数定义
{
  "name": "page",
  "in": "query",
  "schema": {
    "type": "integer",
    "minimum": 1,
    "default": 1,
    "example": 1
  },
  "description": "页码,必须为数字;未传时为 1。"
}
limitqueryinteger可选

每页数量,必须为数字;未传时为 10,传 0 表示不分页。

完整参数定义
{
  "name": "limit",
  "in": "query",
  "schema": {
    "type": "integer",
    "minimum": 0,
    "default": 10,
    "example": 10
  },
  "description": "每页数量,必须为数字;未传时为 10,传 0 表示不分页。"
}
typequerystring可选

按配置类型筛选:site 为网站默认配置,stream 为四层转发默认配置。

完整参数定义
{
  "name": "type",
  "in": "query",
  "schema": {
    "type": "string",
    "enum": [
      "site",
      "stream"
    ],
    "example": "site"
  },
  "description": "按配置类型筛选:`site` 为网站默认配置,`stream` 为四层转发默认配置。"
}
enablequeryinteger可选

按启用状态筛选;仅当传入非空值时生效。

完整参数定义
{
  "name": "enable",
  "in": "query",
  "schema": {
    "type": "integer",
    "enum": [
      0,
      1
    ],
    "example": 1
  },
  "description": "按启用状态筛选;仅当传入非空值时生效。"
}
namequerystring可选

按配置项名称精确筛选。

完整参数定义
{
  "name": "name",
  "in": "query",
  "required": false,
  "schema": {
    "type": "string",
    "example": "proxy_cache"
  },
  "description": "按配置项名称精确筛选。"
}
uidqueryinteger可选

管理员可选。按归属用户 ID 筛选;普通用户不能借此查看其他用户。

完整参数定义
{
  "name": "uid",
  "in": "query",
  "required": false,
  "schema": {
    "type": "integer",
    "minimum": 1,
    "example": 12
  },
  "description": "管理员可选。按归属用户 ID 筛选;普通用户不能借此查看其他用户。"
}

响应

HTTP 200

请求已被处理。成功时返回配置列表与总数;页码或每页数量格式错误时仍返回 HTTP 200,并给出业务错误码。

application/json

object

字段类型必填说明与约束
codeinteger必填

业务状态码;成功为 0。

约束 / 默认值 / 示例
{
  "example": 0
}
countinteger必填

符合筛选条件的配置总数。

约束 / 默认值 / 示例
{
  "minimum": 0,
  "example": 1
}
dataarray <object>必填

用户配置列表。

展开字段结构

用户配置列表。

数组元素 · object
字段类型必填说明与约束
idinteger必填

用户配置 ID。

uidinteger必填

归属用户 ID。

usernamestring可选

归属用户名。

约束 / 默认值 / 示例
{
  "nullable": true
}
namestring必填

配置项名称。

valuestring必填

配置值,具体格式由配置项名称和类型决定。

typestring必填

配置类型:site 或 stream。

scope_namestring必填

作用域名称,例如 global、group。

scope_idinteger必填

作用域 ID。

site_group_namestring可选

当作用域为网站分组时对应的网站分组名称。

约束 / 默认值 / 示例
{
  "nullable": true
}
stream_group_namestring可选

当作用域为转发组时对应的转发组名称。

约束 / 默认值 / 示例
{
  "nullable": true
}
enableinteger必填

启用状态。

约束 / 默认值 / 示例
{
  "enum": [
    0,
    1
  ]
}
create_atstring可选

创建时间。

update_atstring可选

更新时间。

完整 Schema
{
  "type": "object",
  "required": [
    "code",
    "count",
    "data"
  ],
  "properties": {
    "code": {
      "type": "integer",
      "description": "业务状态码;成功为 0。",
      "example": 0
    },
    "count": {
      "type": "integer",
      "minimum": 0,
      "description": "符合筛选条件的配置总数。",
      "example": 1
    },
    "data": {
      "type": "array",
      "description": "用户配置列表。",
      "items": {
        "type": "object",
        "required": [
          "id",
          "uid",
          "name",
          "value",
          "type",
          "scope_name",
          "scope_id",
          "enable"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "description": "用户配置 ID。"
          },
          "uid": {
            "type": "integer",
            "description": "归属用户 ID。"
          },
          "username": {
            "type": "string",
            "nullable": true,
            "description": "归属用户名。"
          },
          "name": {
            "type": "string",
            "description": "配置项名称。"
          },
          "value": {
            "type": "string",
            "description": "配置值,具体格式由配置项名称和类型决定。"
          },
          "type": {
            "type": "string",
            "description": "配置类型:site 或 stream。"
          },
          "scope_name": {
            "type": "string",
            "description": "作用域名称,例如 global、group。"
          },
          "scope_id": {
            "type": "integer",
            "description": "作用域 ID。"
          },
          "site_group_name": {
            "type": "string",
            "nullable": true,
            "description": "当作用域为网站分组时对应的网站分组名称。"
          },
          "stream_group_name": {
            "type": "string",
            "nullable": true,
            "description": "当作用域为转发组时对应的转发组名称。"
          },
          "enable": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "启用状态。"
          },
          "create_at": {
            "type": "string",
            "description": "创建时间。"
          },
          "update_at": {
            "type": "string",
            "description": "更新时间。"
          }
        }
      }
    }
  }
}

示例

{
  "code": 0,
  "count": 1,
  "data": [
    {
      "id": 9,
      "uid": 12,
      "username": "demo",
      "name": "proxy_cache",
      "value": "[]",
      "type": "site",
      "scope_name": "global",
      "scope_id": 0,
      "enable": 1,
      "create_at": "2026-01-01 12:00:00",
      "update_at": "2026-01-01 12:00:00"
    }
  ]
}

查询成功

{
  "code": 0,
  "count": 1,
  "data": [
    {
      "id": 9,
      "uid": 12,
      "username": "demo",
      "name": "proxy_cache",
      "value": "[]",
      "type": "site",
      "scope_name": "global",
      "scope_id": 0,
      "enable": 1,
      "create_at": "2026-01-01 12:00:00",
      "update_at": "2026-01-01 12:00:00"
    }
  ]
}

页码格式错误

{
  "code": "user_config-1",
  "msg": "page参数格式不正确",
  "data": ""
}

cURL 示例

根据文档生成;请替换主控地址、路径参数和凭证,并按上表补充查询参数。

curl --request GET \
  "https://master.example.invalid/v1/user-configs" \
  --header "access-token: YOUR_ACCESS_TOKEN"

查看完整接口 JSON