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

获取验证码配置

GET/v1/common/captcha-type

获取登录/注册页面所需的验证码类型配置。接口读取系统 captcha_type 配置,并补充腾讯云验证码 appid、带有效期的加密 appid 令牌以及极验 captcha_id;未配置第三方验证码时对应字段为空字符串。该公共接口不要求登录。

身份认证

无需身份认证。

请求参数

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

响应

HTTP 200

业务结果通过 HTTP 200 返回。成功时返回配置对象;系统维护或认证状态不影响该公共 GET 接口,数据库配置读取异常则不会生成业务错误响应。

application/json

object

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

成功状态码,验证码配置读取成功时固定为 0。

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

配置读取成功时固定为空字符串。

约束 / 默认值 / 示例
{
  "enum": [
    ""
  ]
}
dataobject必填

系统验证码类型配置及服务端补充的第三方验证码参数。

约束 / 默认值 / 示例
{
  "required": [
    "email",
    "phone",
    "appid",
    "appid_encrypt",
    "geetest_captcha_id"
  ],
  "additionalProperties": true
}
展开字段结构

系统验证码类型配置及服务端补充的第三方验证码参数。

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

邮箱验证码方式配置值,例如空字符串表示未启用。

phonestring必填

手机验证码方式配置值,例如 native 表示内置方式。

appidstring必填

腾讯云验证码 AppID;未配置时为空字符串。

appid_encryptstring必填

使用腾讯云密钥加密的短期 AppID 参数;未配置时为空字符串,示例使用占位值。

geetest_captcha_idstring必填

极验验证码 captcha_id;未配置时为空字符串。

完整 Schema
{
  "type": "object",
  "required": [
    "code",
    "msg",
    "data"
  ],
  "properties": {
    "code": {
      "type": "integer",
      "enum": [
        0
      ],
      "description": "成功状态码,验证码配置读取成功时固定为 0。"
    },
    "msg": {
      "type": "string",
      "enum": [
        ""
      ],
      "description": "配置读取成功时固定为空字符串。"
    },
    "data": {
      "type": "object",
      "required": [
        "email",
        "phone",
        "appid",
        "appid_encrypt",
        "geetest_captcha_id"
      ],
      "properties": {
        "email": {
          "type": "string",
          "description": "邮箱验证码方式配置值,例如空字符串表示未启用。"
        },
        "phone": {
          "type": "string",
          "description": "手机验证码方式配置值,例如 native 表示内置方式。"
        },
        "appid": {
          "type": "string",
          "description": "腾讯云验证码 AppID;未配置时为空字符串。"
        },
        "appid_encrypt": {
          "type": "string",
          "description": "使用腾讯云密钥加密的短期 AppID 参数;未配置时为空字符串,示例使用占位值。"
        },
        "geetest_captcha_id": {
          "type": "string",
          "description": "极验验证码 captcha_id;未配置时为空字符串。"
        }
      },
      "additionalProperties": true,
      "description": "系统验证码类型配置及服务端补充的第三方验证码参数。"
    }
  },
  "additionalProperties": false
}

示例

{
  "code": 0,
  "msg": "",
  "data": {
    "email": "",
    "phone": "native",
    "appid": "",
    "appid_encrypt": "",
    "geetest_captcha_id": ""
  }
}

cURL 示例

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

curl --request GET \
  "https://master.example.invalid/v1/common/captcha-type"

查看完整接口 JSON