import com.chinaums.open.api.OpenApiCache;
import com.chinaums.open.api.OpenApiContext;
import com.chinaums.open.api.constants.ConfigBean;
import com.chinaums.open.api.internal.util.http.HttpTransport;
import java.util.UUID;
public class OpenApiSdkTest {
public static void main(String[] args) throws Exception{
String url = "/v1/datacenter/smartverification/encrypted/blacklist/verify";
//开发者ID
String appId = "平台分配";
//开发者秘钥
String appKey = "平台分配";
//实例化客户端
ConfigBean configBean = new ConfigBean();
OpenApiContext context = new OpenApiContext();
String request = "{\"data\":\"\"}";
context.setStartTime(System.currentTimeMillis());
context.setRequestId(UUID.randomUUID().toString().replace("-", ""));
context.setOpenServUrl(url.split("/v")[0].concat("/"));
context.setApiServiceUrl(url);
context.setVersion(url.split("/")[3]);
context.setAppId(appId);
context.setAppKey(appKey);
context.setConfigBean(configBean);
context.setServiceCode(url.split("/v")[1].substring(1));
OpenApiCache.getCurrentToken(context);
System.out.println(HttpTransport.getInstance().doPost(context, request));
}
}
<?php
require_once "../utils/Log.php";
require_once "../utils/Tools.php";
require_once "../DefaultOpenApiClient.php";
class DataRequest
{
public $url = "";
public $serviceCode = "";
public $apiVersion ="";
public $needToken = true;
public $needDataTag = false;
public $data;
function __construct($data, $url)
{
$this->data = $data;
$apiVersion = preg_split("/[/]+/s",$url)[2];
$this->apiVersion = $apiVersion;
$serviceCode = strstr($url,$apiVersion);
$this->url = strstr($url,"/".$apiVersion,true);
$this->serviceCode = preg_replace("/^" . preg_quote($apiVersion, "/") . "/", "", $serviceCode);
}
}
class DataDemo{
public function main(){
$appid = "平台分配";
$appkey = "平台分配";
$url = "/v1/datacenter/smartverification/encrypted/blacklist/verify";
$data = json_encode(array("data"=>""));
$reqiest = new DataRequest($data,$url);
$client = new DefaultOpenApiClient();
$content = $client->execute($reqiest,$appid,$appkey);
$obj = json_decode($content);
print_r($obj->errCode);
print_r($obj->errInfo);
}
}
$p = new DataDemo();
$p->main();
?>
# -*- coding: utf-8 -*-
from webapi.DefaultOpenApiClient import DefaultOpenApiClient
url = "/v1/datacenter/smartverification/encrypted/blacklist/verify"
class DataRequest(object):
def __init__(self, data: dict) -> dict:
self.data = data
self.serviceCode = url[len(url.split("/v")[0])+len(url.split("/")[3])+1: len(url)]
self.apiVersion = url.split("/")[3]
self.needToken = True
self.needDataTag = True
appId="平台分配"
appKey="平台分配"
client = DefaultOpenApiClient(appId, appKey)
cls = DataRequest({\"data\":\"\"})
response = client.execute(cls)
print(str(response.get("data")))
print(response.get("errCode"))
print(response.get("errInfo"))
print(response.get("resultCode"))
print(response.get("resultInfo"))
黑名单查询
URL
- 生产环境:
POST
https://api-mop.chinaums.com/v1/datacenter/smartverification/encrypted/blacklist/verify
描述:进行黑名单查询操作
ContentType:HTTP(S) + JSON
请求头
名称 | 必填 | 描述 | 示例值 |
---|---|---|---|
Authorization | 是 | 认证内容 | |
Content-Type | 是 | application/json;charset=utf-8 |
请求参数
名称 | 类型 | 必填 | 最大长度 | 描述 | 示例值 |
---|---|---|---|---|---|
data | stringObject | 是 | 对下面转换的Json字符串用SM2公钥进行加密,然后对加密后的报文用base64编码 | ||
keyType | string | 是 | - | 关键字类型。01:身份证号 02:银行卡号 04:电话号码 注:“银联黑名单渠道”仅限01、02、04 | |
certId | string | 否 | - | 身份证号,对应关键字类型01。格式要求:限定字符长度为15位或18位 | |
encryptType | string | 是 | - | 加密类型。01:明文 | |
cardNo | string | 否 | - | 银行卡号,对应关键字 | |
telephone | string | 否 | - | 电话号码,对应关键字类型04。 | |
userNo | string | 否 | - | 用户号 |
响应示例
{
"errCode":"",
"errInfo":"",
"data":""
}
响应参数
名称 | 类型 | 必填 | 最大长度 | 描述 | 示例值 |
---|---|---|---|---|---|
errCode | string | 是 | - | 错误代码 详见错误码说明 | |
errInfo | string | 是 | - | 错误说明 | |
data | stringObject | 是 | 对返回加密报文用base64解码后,用SM2对应的私钥解密 | ||
keyType | string | 是 | 64 | 关键字类型。01:身份证号 02:银行卡号 03:商户标识 04:电话号码 | |
certId | string | 是 | 64 | 身份证号。对应关键字类型01。格式要求:限定字符长度为15位或18位 | |
cardNo | string | 是 | 64 | 银行卡号。对应关键字类型02。格式要求:13-19位数字 | |
telephone | string | 是 | 64 | 电话号码,对应关键字类型04 | |
respCode | string | 是 | 64 | 应答码 | |
respMsg | string | 是 | 64 | 应答码描述 | |
detailRespCode | string | 是 | 64 | 细分应答码 | |
detailRespMsg | string | 是 | 64 | 细分应答码描述 |
错误码
错误码 | 错误描述 | 解决方案 |
---|---|---|
1001 | 未命中不良持卡人 | 细分应答码 |
1002 | 命中不良持卡人 | 细分应答码 |
1003 | 未命中经济犯罪人员 | 细分应答码 |
1004 | 命中经济犯罪人员 | 细分应答码 |
1005 | 未命中中失信人员 | 细分应答码 |
1006 | 命中中失信人员 | 细分应答码 |
1007 | 未命中涉恐人员 | 细分应答码 |
1008 | 命中涉恐人员 | 细分应答码 |
1009 | 未命中触犯风险规则人员 | 细分应答码 |
1010 | 命中触犯风险规则人员 | 细分应答码 |
1011 | 未命中营销套利标签 | 细分应答码 |
1012 | 命中营销套利标签 | 细分应答码 |
2001 | 未命中不良持卡人 | 细分应答码 |
2002 | 命中不良持卡人 | 细分应答码 |
2003 | 未命中期诈交易卡片 | 细分应答码 |
2004 | 命中期诈交易卡片 | 细分应答码 |
2005 | 未命中涉案卡片 | 细分应答码 |
2006 | 命中涉案卡片 | 细分应答码 |
2007 | 未命中线下卡号黑名单 | 细分应答码 |
2008 | 命中线下卡号黑名单 | 细分应答码 |
2009 | 未命中线上卡号黑名单 | 细分应答码 |
2010 | 命中线上卡号黑名单 | 细分应答码 |
2011 | 未命中其它卡号黑名单 | 细分应答码 |
2012 | 命中其它卡号黑名单 | 细分应答码 |
2013 | 未命中营销套利标签 | 细分应答码 |
2014 | 命中营销套利标签 | 细分应答码 |
4001 | 未命中银联线上的交易手机号黑名单 | 细分应答码 |
4002 | 命中银联线上的交易手机号黑名单 | 细分应答码 |
4003 | 未命中虚假手机号黑名单 | 细分应答码 |
4004 | 命中虚假手机号黑名单 | 细分应答码 |
4005 | 未命中欺诈电话号码 | 细分应答码 |
4006 | 命中欺诈电话号码 | 细分应答码 |
4007 | 未命中营销套利标签 | 细分应答码 |
4008 | 命中营销套利标签 | 细分应答码 |