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

获取当前用户控制台概览

GET/v1/user/overview

返回当前登录用户在控制台首页展示的资源和账户概览,包括有效用户套餐数量、即将续费数量、余额、实名认证状态、域名、证书和四层转发端口统计。

身份认证

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 同时发送。"
  }
}

请求参数

未定义路径、查询或请求头参数。

响应

HTTP 200

请求已被处理。成功时 data 为当前用户概览数据。

application/json

object

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

业务状态码;成功为 0。

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

成功时为空字符串。

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

当前用户的资源与账户概览。

约束 / 默认值 / 示例
{
  "required": [
    "uid",
    "user_package_count",
    "renew",
    "balance",
    "cert_verified",
    "auth2_enable",
    "auth2_verified",
    "domain_count",
    "cert_count",
    "stream_port_count"
  ]
}
展开字段结构

当前用户的资源与账户概览。

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

当前登录用户 ID。

约束 / 默认值 / 示例
{
  "example": 12
}
user_package_countinteger必填

未到期的用户套餐数量。

约束 / 默认值 / 示例
{
  "minimum": 0,
  "example": 1
}
renewinteger必填

将在 24 小时内到期或已到期的用户套餐数量。

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

账户余额,单位为元。

约束 / 默认值 / 示例
{
  "example": 98.5
}
cert_verifiedinteger必填

个人实名认证是否通过。

约束 / 默认值 / 示例
{
  "enum": [
    0,
    1
  ],
  "example": 1
}
auth2_enableinteger必填

是否启用二次实名认证。

约束 / 默认值 / 示例
{
  "enum": [
    0,
    1
  ],
  "example": 0
}
auth2_verifiedinteger必填

二次实名认证是否通过。

约束 / 默认值 / 示例
{
  "enum": [
    0,
    1
  ],
  "example": 0
}
domain_countinteger必填

当前用户全部域名数量。

约束 / 默认值 / 示例
{
  "minimum": 0,
  "example": 6
}
cert_countinteger必填

具有私钥的证书数量。

约束 / 默认值 / 示例
{
  "minimum": 0,
  "example": 2
}
stream_port_countinteger必填

当前用户全部四层转发监听端口总数。

约束 / 默认值 / 示例
{
  "minimum": 0,
  "example": 3
}
完整 Schema
{
  "type": "object",
  "required": [
    "code",
    "msg",
    "data"
  ],
  "properties": {
    "code": {
      "type": "integer",
      "description": "业务状态码;成功为 0。",
      "example": 0
    },
    "msg": {
      "type": "string",
      "description": "成功时为空字符串。",
      "example": ""
    },
    "data": {
      "type": "object",
      "required": [
        "uid",
        "user_package_count",
        "renew",
        "balance",
        "cert_verified",
        "auth2_enable",
        "auth2_verified",
        "domain_count",
        "cert_count",
        "stream_port_count"
      ],
      "description": "当前用户的资源与账户概览。",
      "properties": {
        "uid": {
          "type": "integer",
          "description": "当前登录用户 ID。",
          "example": 12
        },
        "user_package_count": {
          "type": "integer",
          "minimum": 0,
          "description": "未到期的用户套餐数量。",
          "example": 1
        },
        "renew": {
          "type": "integer",
          "minimum": 0,
          "description": "将在 24 小时内到期或已到期的用户套餐数量。",
          "example": 0
        },
        "balance": {
          "type": "number",
          "description": "账户余额,单位为元。",
          "example": 98.5
        },
        "cert_verified": {
          "type": "integer",
          "enum": [
            0,
            1
          ],
          "description": "个人实名认证是否通过。",
          "example": 1
        },
        "auth2_enable": {
          "type": "integer",
          "enum": [
            0,
            1
          ],
          "description": "是否启用二次实名认证。",
          "example": 0
        },
        "auth2_verified": {
          "type": "integer",
          "enum": [
            0,
            1
          ],
          "description": "二次实名认证是否通过。",
          "example": 0
        },
        "domain_count": {
          "type": "integer",
          "minimum": 0,
          "description": "当前用户全部域名数量。",
          "example": 6
        },
        "cert_count": {
          "type": "integer",
          "minimum": 0,
          "description": "具有私钥的证书数量。",
          "example": 2
        },
        "stream_port_count": {
          "type": "integer",
          "minimum": 0,
          "description": "当前用户全部四层转发监听端口总数。",
          "example": 3
        }
      }
    }
  }
}

示例

{
  "code": 0,
  "msg": "",
  "data": {
    "uid": 12,
    "user_package_count": 1,
    "renew": 0,
    "balance": 98.5,
    "cert_verified": 1,
    "auth2_enable": 0,
    "auth2_verified": 0,
    "domain_count": 6,
    "cert_count": 2,
    "stream_port_count": 3
  }
}

获取成功

{
  "code": 0,
  "msg": "",
  "data": {
    "uid": 12,
    "user_package_count": 1,
    "renew": 0,
    "balance": 98.5,
    "cert_verified": 1,
    "auth2_enable": 0,
    "auth2_verified": 0,
    "domain_count": 6,
    "cert_count": 2,
    "stream_port_count": 3
  }
}

cURL 示例

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

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

查看完整接口 JSON