逐梦者
逐梦者

MatAuthcode-api验证码api使用手册

MatAuthcode-api验证码api使用手册

Mat验证码API使用手册

  1. 接受GET和POST访问方式
  2. 需要传入的字段有 sessionid value apikey

 

1.其中sessionid 是请求验证码的客户端在请求验证码时的sessionid

获取方法

<?php$sessionid=session_id();

这样就获取到了sessionid

 

2.value 是用户计算的值

3.apikey 是开发者获取到的许可

3.本api返回的是json数据

status 是计算的结果 false是具体解释

返回的状态码会有

600 : ok  表示计算结果正确

601 : false 表示计算结果错误

603 : 表示错误的api密钥请联系开发者获取api密钥或者检查密钥是否有误

 

调用实例


$sessionid=session_id();//获取获取验证图片会话session 如果另外一种调用方式请传入sessionid值
$authcode=$_GET['authcode'];//计算的结果
$apikey="";//填入apikey
$vars = array(
    'sessionid'=>$sessionid,
    'value'=>$authcode,
    'apikey'=>$apikey
);
$uri = '';//校验api地址
$ch = curl_init ();
curl_setopt ( $ch, CURLOPT_URL, $uri );
curl_setopt ( $ch, CURLOPT_POST, 1 );
curl_setopt ( $ch, CURLOPT_HEADER, 0 );
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt ( $ch, CURLOPT_POSTFIELDS, $vars );
$return = curl_exec ( $ch );
curl_close ( $ch );
$remotresult=json_decode($return,true);//解析成普通数组,不加true就是对象数组
$remotresult['status'];//我们需要的结果状态码 600 成功 601 计算错误 603 api错误
if($remotresult['status']==600){
    echo("验证成功");
}elseif($remotresult['status']==601){
    die("验证失败");
}

 

[dangerbox title=”说明”]

需要使用请联系站长

[/dangerbox]

[infobox title=”接口地址”]

图片:https://api.public.iot.xnpu.top/Authcode/V1/code/

校验api:https://api.public.iot.xnpu.top/Authcode/V1/api/

[/infobox]

 

 

 

# # #
首页      文章      分享      MatAuthcode-api验证码api使用手册

发表回复

textsms
account_circle
email

Captcha Code

逐梦者

MatAuthcode-api验证码api使用手册
Mat验证码API使用手册 接受GET和POST访问方式 需要传入的字段有 sessionid value apikey   1.其中sessionid 是请求验证码的客户端在请求验证码时的sessionid 获取…
扫描二维码继续阅读
2022-01-21