POST/api/v1/captcha/verify校验验证码答案
Try it 面板需要启用 JavaScript。
答案正确则消费挑战工单、签发已验证工单,供登录等编排回源确认。
Request
| Name | Data Type | Required | Description |
| Content-Type | string | Yes | 请求体内容类型(默认值 "application/json") |
type RequestHeaders = {
/** 请求体内容类型,默认值 "application/json" */
Content-Type: string
}
{
"Content-Type": "application/json"
}
Body
| Name | Data Type | Required | Description |
| ticket | string | Yes | 挑战工单(challenge 返回的 ticket) |
| answer | string | Yes | 用户输入的答案 |
type RequestBody = {
/** 挑战工单(challenge 返回的 ticket) */
ticket: string
/** 用户输入的答案 */
answer: string
}
{
"ticket": "cpt_6f13bc82e0497a51",
"answer": "7H4K"
}
Response
Body
| Name | Data Type | Required | Description |
| captchaTicket | string | Yes | 已验证工单(登录等接口携带) |
type ResponseBody = {
/** 已验证工单(登录等接口携带) */
captchaTicket: string
}
{
"captchaTicket": "cpv_5e02ab71d3890f64"
}
HTTP Code
| HTTP Status |
Meaning |
Notes |
| 200 |
成功 |
返回已验证工单 |
| 400 |
答案错误或工单无效 |
挑战校验失败 |
| 429 |
尝试次数超限 |
单挑战尝试次数用尽,需重新签发 |
Response Code
响应使用统一信封 {id, code, messages, result},其 code 字段:
| code |
Meaning |
Notes |
| 0 |
成功 |
返回已验证工单 |
| 2101 |
答案错误 |
挑战校验失败 |
| 2102 |
工单无效 |
挑战工单不存在、过期或已消费 |
| 2103 |
尝试次数超限 |
单挑战尝试次数用尽 |
Examples
POST /api/v1/captcha/verify
Content-Type: application/json
{
"ticket": "cpt_6f13bc82e0497a51",
"answer": "7H4K"
}
{
"id": "01JD8SJGI3N0M4K5",
"code": 0,
"messages": [],
"result": { "captchaTicket": "cpv_5e02ab71d3890f64" }
}