API: Factor/mobile - 運營商二要素
概覽
? factor/mobile
是 SUBMAIL 的簡版身份驗證 API,可以根據(jù)手機號碼和姓名判斷兩者是否一致。需注意,此接口不會返回運營商相關(guān)信息。
URL
<主> http://tpa.mysubmail.com/factor/mobile
<備> https://tpa.mysubmail.com/factor/mobile
http 請求方式
請求方式 | content-type 設(shè)置 |
---|---|
http post | multipart/form-data 、x-www-form-urlencoded 、application/json |
signature創(chuàng)建規(guī)則
1.請將以下參數(shù)按照字段升序(A-Z)排列
appkey、mobile、name、timestamp
2.創(chuàng)建簽名字符串 :以"key=value" + "&"(連接符)+ "key=value" 的方式連接所有參數(shù)
3.創(chuàng)建簽名:拼接簽名字符串示例string = "appkey=xxxx&mobile=188xxxx&name=張三& timestamp=1602792765",然后使用sha256(string)創(chuàng)建簽名
注:中文需要使用urlencode處理后再參與創(chuàng)建簽名
請求參數(shù)
參數(shù) | 類型 | 必需/可選 | 默認 | 描述 |
---|---|---|---|---|
appid | string | 必需 | 無 | appid,自控制臺獲取 |
timestamp | string | 必需 | 無 | 時間戳 |
name | string | 必需 | 無 | 待驗證的身份證姓名 |
mobile | string | 必需 | 無 | 待驗證的號碼 |
signature | string | 必需 | 無 | sha256 加密校驗數(shù)字證書 |
返回參數(shù)格式
jsonString
代碼示例
詳情請查詢demo示例文檔
響應(yīng)消息
API請求失敗
{
// 狀態(tài)描述
'status' : 'error' ,
// API流水號
'send_id' : '"********************************",
// API返回的狀態(tài)碼 詳情查看 API錯誤代碼與描述 文檔
'code' : 1201 ,
// API返回的描述
'msg' : 'Incorrect APP ID.' ,
}
API請求成功
{
"status": "success",
"send_id": "********************************",
"result": {
//true 一致 false 不一致
"identical": true,
//01 一致 02 不一致
"status": "01",
//返回結(jié)果描述
"msg": "一致",
}
}
identical和status 參數(shù)意義相同
//認證不一致
{
"status": "success",
"send_id": "********************************",
"result": {
"identical": false,
"status": "02",
"msg": "認證不一致",
}
}