今天推荐免费测试运营商核验API类接口,可以免费试用,记得点赞收藏哈!
接口名称:运营商三要素
接口用途:
1.传入姓名、身份证号码、手机号码,验证三要素信息是否一致,返回验证结果。
2.直连三大运营商,支持携号转网,实时核验。
首先打开阿里云,点击运营商三要素接口,选择购买免费试用。
然后点击卖家控制台,获取APPcode进行调试接口。
目前支持多种语言接入,比如JAVA、C#等,以JAVA为例:
public static void main(String[] args) {
String host = "https://kzmobile3.market.alicloudapi.com";
String path = "/api-mall/api/mobile_three/check";
String method = "POST";
String appcode = "你自己的AppCode";
Map<String, String> headers = new HashMap<String, String>();
//最后在header中的格式(中间是英文空格)为Authorization:APPCODE 83359fd73fe94948385f570e3c139105
headers.put("Authorization", "APPCODE " + appcode);
//根据API的要求,定义相对应的Content-Type
headers.put("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
Map<String, String> querys = new HashMap<String, String>();
Map<String, String> bodys = new HashMap<String, String>();
bodys.put("mobile", "mobile");
bodys.put("name", "name");
bodys.put("idcard", "idcard");
try {
/**
* 重要提示如下:
* HttpUtils请从
* https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/src/main/java/com/aliyun/api/gateway/demo/util/HttpUtils.java
* 下载
*
* 相应的依赖请参照
* https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/pom.xml
*/
HttpResponse response = HttpUtils.doPost(host, path, method, headers, querys, bodys);
System.out.println(response.toString());
//获取response的body
//System.out.println(EntityUtils.toString(response.getEntity()));
} catch (Exception e) {
e.printStackTrace();
}
}
成功响应,返回200状态码。
"msg": "成功",
"success": true,
"code": 200,
"data": {
"result": "0", //0一致 ,1不一致,2库无或销户
"orderNo": "202406282055560705659",
"desc": "一致"