接口路径(新):http://api.okayapi.com/api/App/Captcha/Create
接口路径(旧):http://api.okayapi.com/?s=App.Captcha.Create
接口描述: 生成一个新的验证码,可在小白开放平台进行相关参数配置。返回时可选择直接输出验证码图片,也可以选择返回数据。请注意,需要保管好captcha_id(直接输出图片时通过COOKIE返回),以便校验时核对。
Parameter | Type | Required | Default | Note | Description |
---|---|---|---|---|---|
HTTP_APPKEY | String | Required | MIN: 32 | Common Put Your APPKEY | |
return_format | Enum | Optaion | output | Range: output/data | 验证码返回格式,output表示直接输出验证码图片,data表示返回base64后的验证码图片数据 |
KEY | Type | Description |
---|---|---|
err_code | Int | 操作码,0表示成功,正数表示业务失败场景,负数表示系统失败场景 |
err_msg | String | 错误提示信息,err_code非0时参考此提示信息 |
captcha_id | String | 验证码唯一ID,用于校验时核对(return_format=data时返回此字段) |
captcha_img | String | 验证码图片base64后的数据(return_format=data时返回此字段) |
接口路径(新):http://api.okayapi.com/api/App/Captcha/Verify
接口路径(旧):http://api.okayapi.com/?s=App.Captcha.Verify
接口描述: 对用户输入的验证码进行核对,最多只能校验一次,失败后需要刷新验证码并重新验证
Parameter | Type | Required | Default | Note | Description |
---|---|---|---|---|---|
HTTP_APPKEY | String | Required | MIN: 32 | Common Put Your APPKEY | |
captcha_id | String | Required | MIN: 6 | 验证码唯一ID,通过App.Captcha.Create接口返回 | |
captcha_code | String | Required | MIN: 2;MAX: 10 | 待校验的验证码 |
KEY | Type | Description |
---|---|---|
err_code | Int | 操作码,0表示验证通过,1表示验证码已过期,或不存在,2表示验证码错误,需要刷新重试 |
err_msg | String | 错误提示信息,err_code非0时参考此提示信息 |
接口路径(新):http://api.okayapi.com/api/App/Captcha/Create4
接口路径(旧):http://api.okayapi.com/?s=App.Captcha.Create4
接口描述: 生成四位图片验证码,支持多种组合,例如:纯数字、纯字母或数字和字母的组合
Parameter | Type | Required | Default | Note | Description |
---|---|---|---|---|---|
HTTP_APPKEY | String | Required | MIN: 32 | Common Put Your APPKEY | |
cap_type | Int | Optaion | 0 | 验证码的字符集类型,0纯数字,1纯小写字母,2纯大写字母,3数字+小写字母,4数字+大写字母,5大小写字母,6数字+大小写字母 | |
cap_width | Int | Optaion | 150 | 验证码图片宽度,单位:px | |
cap_height | Int | Optaion | 40 | 验证码图片高度,单位:px |
{
"ret": 200,
"data": {
"err_code": 0,
"err_msg": "",
"img_url": "http://cd7.yesapi.net/CEE4B8A091578B252AC4C92FB4E893C3_20220428173857_955e98d069e35b12fd331e53033d91e0.jpg",
"code": "7961"
},
"msg": "V3.3.0 YesApi App.Captcha.Create4 2022-04-28 17:38:57 hn1"
}
KEY | Type | Description |
---|---|---|
err_code | Int | 操作码,0表示生成成功 |
err_msg | String | 错误提示信息,err_code非0时参考此提示信息 |
img_url | String | 验证码图片地址,例如:http://cd7.yesapi.net/CEE4B8A091578B252AC4C92FB4E893C3_20220428173857_955e98d069e35b12fd331e53033d91e0.jpg |
code | String | 验证码字符串,如:7691 |
接口路径(新):http://api.okayapi.com/api/App/Captcha/Create6
接口路径(旧):http://api.okayapi.com/?s=App.Captcha.Create6
接口描述: 生成六位图片验证码,支持多种组合,例如:纯数字、纯字母或数字和字母的组合
Parameter | Type | Required | Default | Note | Description |
---|---|---|---|---|---|
HTTP_APPKEY | String | Required | MIN: 32 | Common Put Your APPKEY | |
cap_type | Int | Optaion | 0 | 验证码的字符集类型,0纯数字,1纯小写字母,2纯大写字母,3数字+小写字母,4数字+大写字母,5大小写字母,6数字+大小写字母 | |
cap_width | Int | Optaion | 150 | 验证码图片宽度,单位:px | |
cap_height | Int | Optaion | 40 | 验证码图片高度,单位:px |
{
"ret": 200,
"data": {
"err_code": 0,
"err_msg": "",
"img_url": "http://cd7.yesapi.net/CEE4B8A091578B252AC4C92FB4E893C3_20220428174318_ddd1b745b77feb2e6b8629605b134652.jpg",
"code": "254866"
},
"msg": "V3.3.0 YesApi App.Captcha.Create6 2022-04-28 17:43:18 hn1"
}
KEY | Type | Description |
---|---|---|
err_code | Int | 操作码,0表示生成成功 |
err_msg | String | 错误提示信息,err_code非0时参考此提示信息 |
img_url | String | 验证码图片地址,例如:http://cd7.yesapi.net/CEE4B8A091578B252AC4C92FB4E893C3_20220428174318_ddd1b745b77feb2e6b8629605b134652.jpg |
code | String | 验证码字符串,如:254866 |
Power by OkayAPI.com Contact us (WA: okayapi OR Email: chanzonghuang@gmail.com).
Timezone: America/New_York Feb/12/2025 14:22:13