图形|图片验证码生成,支持自定义高宽,文字颜色、字体,边框颜色,底色,验证码字数,验证码字符范围等。 默认字符范围使用数字+字母+2500个中文汉字。
浏览量: 188331
调用量: 73977654
使用人数: 24564
¥ 0.01 元起
非文件上传的POST时,enctype=application/x-www-form-urlencoded。
文件上传的POST时,enctype=multipart/form-data。
参数名称 | 类型 | 示例值 | 必须 | 描述 |
---|---|---|---|---|
showapi_appid | String | 100 | 是 | 易源应用id |
showapi_sign | String | 698d51a19d8a121ce581499d7b701668 | 是 | 为了验证用户身份,以及确保参数不被中间人篡改,需要传递调用者的数字签名。 |
showapi_timestamp | String | 20141114142239 | 否 | 客户端时间。
格式yyyyMMddHHmmss,如20141114142239 为了在一定程度上防止“重放攻击”,平台只接受在10分钟之内的请求。如果不传或传空串,则系统不再做此字段的检测。 |
showapi_sign_method | String | md5 | 否 | 签名生成方式,其值可选为"md5"或"hmac"。如果不传入则默认"md5"。 |
showapi_res_gzip | String | 1或0 | 否 | 返回值是否用gzip方式压缩。此值为1时将压缩,其他值不压缩。 |
... |
参数名称 | 类型 | 默认值 | 示例值 | 必须 | 描述 |
---|---|---|---|---|---|
border | String | yes | 否 | 图片边框,合法值:yes , no |
|
border_color | String | black | 105,179,90 |
否 | 边框颜色,合法值: r,g,b (and optional alpha) 或者 white,black,blue. |
border_thickness | String | 1 | 否 | 边框厚度,合法值:0 |
|
image_width | String | 200 | 否 | 图片宽 |
|
image_height | String | 50 | 否 | 图片高 |
|
textproducer_char_string | String | abcde2345678gfynmnpwx | 否 | 文本集合,验证码值从此集合中获取,默认值为英文字母+数字+2500个常用汉字 |
|
textproducer_char_length | String | 5 | 否 | 验证码长度,也就是几个字符 |
|
textproducer_font_names | String | Arial, Courier | 否 | 字体 |
|
textproducer_font_size | String | 40px | 否 | 字体大小 |
|
textproducer_font_color | String | black | 105,179,90 |
否 | 字体颜色,合法值: r,g,b 或者 white,black,blue. |
textproducer_char_space | String | 2 | 否 | 文字间隔 |
|
noise_color | String | black | 105,179,90 |
否 | 干扰颜色,合法值: r,g,b 或者 white,black,blue. |
obscurificator_impl | String | com.google.code.kaptcha.impl.WaterRipple | 否 | 图片样式: 水纹com.google.code.kaptcha.impl.WaterRipple 鱼眼com.google.code.kaptcha.impl.FishEyeGimpy 阴影com.google.code.kaptcha.impl.ShadowGimpy |
|
... |
以JSON格式返回结果。
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
showapi_res_body | String | {"city":"昆明","prov":"云南"} | 消息体的JSON封装,所有应用级的返回参数将嵌入此对象 。 |
showapi_res_code | int | 0 |
易源返回标志,0为成功,其他为失败。
0成功 -1,系统调用错误 -2,可调用次数或金额为0 -3,读取超时 -4,服务端返回数据解析错误 -5,后端服务器DNS解析错误 -6,服务不存在或未上线 -1000,系统维护 -1002,showapi_appid字段必传 -1003,showapi_sign字段必传 -1004,签名sign验证有误 -1005,showapi_timestamp无效 -1006,app无权限调用接口 -1007,没有订购套餐 -1008,服务商关闭对您的调用权限 -1009,调用频率受限 -1010,找不到您的应用 -1011,子授权app_child_id无效 -1012,子授权已过期或失效 -1013,子授权ip受限 |
showapi_res_error | String | 用户输入有误! | 错误信息的展示 |
... |
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
img_path | String | http://img.showapi.com/images/temp/2.jpg |
生成的图片路径 |
text | String | 2n23 |
此验证码图片实际代表的文字 |
ret_code | Number | 0 |
是否成功 |
... |
{
"showapi_res_code": 0,
"showapi_res_error": "",
"showapi_res_body": {
"img_path": "http://img.showapi.com/images/temp/2.jpg",
"text": "中文验证码",
"ret_code": "0"
}
}