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

删除用户配置

DELETE/v1/user-configs/{config_id}

删除一个或多个用户配置。路径参数支持单个配置 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 同时发送。"
  }
}

请求参数

参数位置类型必填说明与约束
config_idpathstring必填

要删除的用户配置 ID,或以英文逗号分隔的 ID 列表;每一项必须是数字。

完整参数定义
{
  "name": "config_id",
  "in": "path",
  "required": true,
  "schema": {
    "type": "string",
    "pattern": "^[0-9]+(,[0-9]+)*$",
    "example": "9,10"
  },
  "description": "要删除的用户配置 ID,或以英文逗号分隔的 ID 列表;每一项必须是数字。"
}

响应

HTTP 200

请求已被处理。成功时 code 为 0、msg 为“用户配置删除成功”、data 为 null;ID 无效、配置不存在或无权限时仍返回 HTTP 200。

application/json

object

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

业务状态码;成功为 0。

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

处理结果说明。

约束 / 默认值 / 示例
{
  "example": "用户配置删除成功"
}
datastring必填

成功时为 null;失败时为空字符串。

约束 / 默认值 / 示例
{
  "nullable": true,
  "example": null
}
完整 Schema
{
  "type": "object",
  "required": [
    "code",
    "msg",
    "data"
  ],
  "properties": {
    "code": {
      "type": "integer",
      "description": "业务状态码;成功为 0。",
      "example": 0
    },
    "msg": {
      "type": "string",
      "description": "处理结果说明。",
      "example": "用户配置删除成功"
    },
    "data": {
      "type": "string",
      "nullable": true,
      "description": "成功时为 null;失败时为空字符串。",
      "example": null
    }
  }
}

示例

{
  "code": 0,
  "msg": "用户配置删除成功",
  "data": null
}

删除成功

{
  "code": 0,
  "msg": "用户配置删除成功",
  "data": null
}

配置不存在

{
  "code": "user_config-16",
  "msg": "用户配置不存在",
  "data": ""
}

cURL 示例

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

curl --request DELETE \
  "https://master.example.invalid/v1/user-configs/{config_id}" \
  --header "access-token: YOUR_ACCESS_TOKEN"

查看完整接口 JSON