itecdn 5.x / 用户 API
获取网站组详情
GET
/v1/site-groups/{group_id}获取当前登录用户的一条网站组。服务端以网站组 ID 和当前登录用户 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 同时发送。"
}
}请求参数
| 参数 | 位置 | 类型 | 必填 | 说明与约束 |
|---|---|---|---|---|
group_id | path | integer | 必填 | 网站组 ID。 完整参数定义 |
响应
HTTP 200
成功、未登录和网站组不存在/无权访问均返回 HTTP 200。
application/json
oneOf
oneOf · 1 · object
| 字段 | 类型 | 必填 | 说明与约束 | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
code | integer | 必填 | 业务状态码;0 表示成功。 约束 / 默认值 / 示例 | ||||||||||||||||||||
msg | string | 必填 | 成功时为空字符串。 约束 / 默认值 / 示例 | ||||||||||||||||||||
data | object | 必填 | 网站组记录。 约束 / 默认值 / 示例展开字段结构网站组记录。
|
oneOf · 2 · object
| 字段 | 类型 | 必填 | 说明与约束 |
|---|---|---|---|
code | string | 必填 | 网站组不存在、无权访问或未登录时的业务错误码。 约束 / 默认值 / 示例 |
msg | string | 必填 | 错误原因。 约束 / 默认值 / 示例 |
data | string | 必填 | 错误响应中的固定空字符串。 约束 / 默认值 / 示例 |
完整 Schema
{
"oneOf": [
{
"type": "object",
"required": [
"code",
"msg",
"data"
],
"properties": {
"code": {
"type": "integer",
"enum": [
0
],
"description": "业务状态码;0 表示成功。"
},
"msg": {
"type": "string",
"description": "成功时为空字符串。",
"example": ""
},
"data": {
"type": "object",
"description": "网站组记录。",
"required": [
"id",
"uid",
"name",
"des"
],
"properties": {
"id": {
"type": "integer",
"description": "网站组 ID。"
},
"uid": {
"type": "integer",
"nullable": true,
"description": "网站组所属用户 ID。"
},
"name": {
"type": "string",
"nullable": true,
"description": "网站组名称。"
},
"des": {
"type": "string",
"nullable": true,
"description": "网站组备注。"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"code",
"msg",
"data"
],
"properties": {
"code": {
"type": "string",
"enum": [
"site_group-3",
"login_required"
],
"description": "网站组不存在、无权访问或未登录时的业务错误码。"
},
"msg": {
"type": "string",
"description": "错误原因。",
"example": "网站组不存在"
},
"data": {
"type": "string",
"description": "错误响应中的固定空字符串。",
"example": ""
}
},
"additionalProperties": false
}
]
}示例
{
"code": 0,
"msg": "",
"data": {
"id": 21,
"uid": 12,
"name": "生产网站",
"des": "主要业务站点"
}
}查询成功
{
"code": 0,
"msg": "",
"data": {
"id": 21,
"uid": 12,
"name": "生产网站",
"des": "主要业务站点"
}
}网站组不存在或无权访问
{
"code": "site_group-3",
"msg": "网站组不存在",
"data": ""
}cURL 示例
根据文档生成;请替换主控地址、路径参数和凭证,并按上表补充查询参数。
curl --request GET \
"https://master.example.invalid/v1/site-groups/{group_id}" \
--header "access-token: YOUR_ACCESS_TOKEN"