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
| 字段 | 类型 | 必填 | 说明与约束 | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
code | integer | 必填 | 业务状态码;成功为 0。 约束 / 默认值 / 示例 | ||||||||||||||||||||||||||||||||||||||||||||
msg | string | 必填 | 成功时为空字符串。 约束 / 默认值 / 示例 | ||||||||||||||||||||||||||||||||||||||||||||
data | object | 必填 | 当前用户的资源与账户概览。 约束 / 默认值 / 示例展开字段结构当前用户的资源与账户概览。
|
完整 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"