获取图形验证码 - ShowCaptcha
功能介绍
获取图形验证码。
URI
GET /api/v2/sdk/captcha
请求参数
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
X-operating-sys-version | 是 | String | 调用方操作系统版本,例如:Android 10。 |
X-device-fingerprint | 是 | String | 调用方设备指纹,例如:156aysdna213sc50。 |
X-device-ip | 否 | String | 调用方IP,例如:10.10.10.1。 |
X-agent | 是 | String | 用户Agent信息,例如:Mozilla/5.0 (Linux; Android 10; Redmi K30 Build/QKQ1.190825.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.99 Mobile Safari/537.36。 |
X-L | 否 | String | 用于国际化语言设置,例如:zh。 |
X-client-id | 是 | String | 应用标识,注册应用后分配的ClientId。 |
X-tenant-id | 否 | String | 租户id,ISV应用调用则为必填,需要将{domain_name}换成ISV通用域名{common_domain},请求Header参数中需要指定对应租户的tenant_id,并将X-client-id换成ISV应用模板的client_id。 |
响应参数
状态码:200
参数 | 参数类型 | 描述 |
|---|---|---|
captchaId | String | 验证码ID。 |
projectCode | String | 项目编码,当前不支持,固定返回null。 |
captchaOriginalPath | String | 验证码原始路径,当前不支持,固定返回null。 |
captchaFontType | String | 验证码字体类型,当前不支持,固定返回null。 |
captchaFontSize | String | 验证码字体大小,当前不支持,固定返回null。 |
secretKey | String | 密钥,当前不支持,固定返回null。 |
originalImageBase64 | String | 原生图片base64。 |
point | String | 滑块点选坐标。 |
jigsawImageBase64 | String | 滑块图片base64。 |
wordList | String | 点选文字。 |
pointList | String | 点选坐标。 |
pointJson | String | 点坐标(base64编码传输)。 |
token | String | 每次请求验证码的唯一标识。 |
result | String | 校验结果。 |
captchaVerification | String | 后台二次校验参数。 |
状态码:400
参数 | 参数类型 | 描述 |
|---|---|---|
error_code | String | 错误码。 |
error_msg | String | 错误详情。 |
请求示例
获取图形验证码。
GET https://{domain_name}/api/v2/sdk/captcha
X-operating-sys-version: Android 10
X-device-fingerprint: 156aysdna213sac
X-device-ip: 10.10.10.1
X-agent: Mozilla/5.0 (Linux; Android 10; Redmi K30 Build/QKQ1.190825.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.99 Mobile Safari/537.36
X-L: zh
X-client-id: DRrYIqauawN0I8myTMoDTPys6ezGZxnm
X-tenant-id: 08f770f51f80d2f40f38c00cb199fd21 响应示例
状态码:200
请求成功。
{
"captchaId" : null,
"projectCode" : null,
"captchaOriginalPath" : null,
"captchaFontType" : null,
"captchaFontSize" : null,
"secretKey" : "yMX******hmq",
"originalImageBase64" : "iVBORw0KGgoAAAANSUhEUgAAATYABj/WRVk78AAAAASUVORK5CYII=",
"point" : null,
"jigsawImageBase64" : "iVBORw0KGgoAAAANSUhEUgADcAAAAASUVORK5CYII=",
"wordList" : null,
"pointList" : null,
"pointJson" : null,
"token" : "389******fd1",
"result" : false,
"captchaVerification" : null
} 状态码
状态码 | 描述 |
|---|---|
200 | 请求成功。 |
400 | 参数无效。 |
错误码
请参见错误码。

