验证码记录详情

GET
https://api.itniotech.com/otp/verification/record/{verificationId}
通过接口查询指定消息id记录详情。
 
请求参数
verificationId
String
必填
消息id
 
请求示例
Request URL:
    https://api.itniotech.com/otp/verification/record/22206051443051000003
Request Method:
    GET
Request Headers:
    Content-Type: application/json;charset=UTF-8
    Sign: 05d7a50893e22a5c4bb3216ae3396c7c
    Timestamp: 1630468800
    Api-Key: bDqJFiq9
 
响应参数
参数 说明 类型
status 状态码,0成功,其他失败参见响应状态码说明 String
reason 失败原因说明 String
data 响应参数详情 JSONObject
verificationId 消息id String
verifications 校验结果详情 JSONObject
matched 验证码的检验结果[0校验成功、 -1未校验、1发送中、2校验失败、3不存在的verificationId ] Int
verifiedDate 校验时间 String
oriReceiver 接收号码 String
channel 通道类型 [sms, call, sna] String
orderId 第三方平台流水号,需全局唯一 String
sms 短信记录详情,verifications.channel=sms,返回此对象 JSONObject
submitTm 提交时间 String
sendTm 发送时间 String
doneTm 完成时间 String
mcc mcc Int
mnc mnc Int
sender 发送者id String
chargeCnt 计费条数 Int
pay 总费用一 String
status 短信发送状态-1发送中 0成功 1失败 Int
reason 失败原因描述 String
call 语音记录详情,verifications.channel=call,返回此对象 JSONObject
terminationCode 发送状态0成功其他失败 Int
terminationReason 状态码描述 String
submitTime 提交时间 String
callTime 呼叫时间 String
ringingTime 响铃时间 String
answerTime 接听时间 String
hangupTime 挂断时间 String
callDuration 通话时长 Int
chargedDuration 计费时长 Int
displayNum 显示号码 String
billPeriodstring 计费周期 String
code 地区供应商 String
rate 费率 String
cost 消费金额(报价币种) String
sna 静默网络登录记录详情,verifications.channel=sna,返回此对象 JSONArray
postVerificationTime 请求校验时间 String
verificationBackTime 校验结果返回时间 String
mcc mcc Integer
mnc mnc Integer
status 验证状态[-1未验证、0成功、1失败] Integer
reason 原因说明 String
 
响应状态码
status 状态说明
0 成功
-1 账号认证异常
-2 ip限制
-16 时间戳过期
-18 系统异常
-22 参数异常
 

LANGUAGE

Java

PHP

REQUEST

 import cn.hutool.crypto.SecureUtil;
 import cn.hutool.http.Header;
 import cn.hutool.http.HttpRequest;
 import cn.hutool.http.HttpResponse;
 import cn.hutool.json.JSONUtil;

 import java.time.LocalDateTime;
 import java.time.ZoneId;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Map;

private void getRecord() {
    final String baseUrl = "https://api.itniotech.com/otp";
    final String apiKey = "your api key";
    final String apiPwd = "your api secret";

    final String verificationId = "{{verificationId}}";
    final String url = baseUrl.concat("/verification/record/").concat(verificationId);
    HttpRequest request = HttpRequest.post(url);

    // currentTime
    final String datetime = String.valueOf(LocalDateTime.now().atZone(ZoneId.systemDefault()).toInstant().getEpochSecond());
    // generate md5 key
    final String sign = SecureUtil.md5(apiKey.concat(apiPwd).concat(datetime));
    request.header(Header.CONNECTION, "Keep-Alive")
            .header(Header.CONTENT_TYPE, "application/json;charset=UTF-8")
            .header("Sign", sign)
            .header("Timestamp", datetime)
            .header("Api-Key", apiKey);

    HttpResponse response = request.execute();
    if (response.isOk()) {
        String result = response.body();
        System.out.println(result);
    }
} 

REQUEST

header('content-type:text/html;charset=utf8');

$apiKey = "your api key";
$apiSecret = "your api secret";

$verificationId = "{{verificationId}}";
$url = "https://api.itniotech.com/otp/verification/record/".$verificationId;

$timeStamp = time();
$sign = md5($apiKey.$apiSecret.$timeStamp);
$headers[] = 'Content-Type: application/json;charset=UTF-8';
$headers[] = "Sign: $sign";
$headers[] = "Timestamp: $timeStamp";
$headers[] = "Api-Key: $apiKey";

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 600);
curl_setopt($ch, CURLOPT_HTTPHEADER,$headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);

$output = curl_exec($ch);
curl_close($ch);

var_dump($output);
 

RESPONSEEXAMPLE

{
    "status": "0",
    "reason": "success",
    "data": {
        "verificationId": "22206051443051000003",
        "verifications":{
            "matched":0,
            "verifiedDate":"2022-01-01T00:00:10+08:00",
            "oriReceiver":"91856321412",
            "channel":"sms",
            "orderId":null
        },
        "sms": {
            "submitTm":"2022-01-01T00:00:00+08:00",
            "sendTm":"2022-01-01T00:00:01+08:00",
            "doneTm":"2022-01-01T00:00:02+08:00",
            "mcc":404,
            "mnc":-1,
            "sender":null,
            "chargeCnt":2,
            "pay":"0.015",
            "status":0,
            "reason":"success"
        },
        "call": null
    }
}