一、什么是企业二要素?
企业二要素,通过输入统一社会信用代码、企业名称或统一社会信用代码、法人名称,验证两者是否匹配一致。
二、企业二要素适用哪些场景?
例如:信用与金融领域
1.信用评级:信用评级机构在对企业进行信用评估时,会依据企业名称和统一社会信用代码来收集和整理企业的相关信息,包括财务状况、经营业绩、市场竞争力等,从而对企业的信用状况进行客观评价,为投资者、金融机构等提供决策参考。
2.金融信贷:企业向金融机构申请贷款、融资等金融服务时,需要提供企业名称和统一社会信用代码,金融机构以此为基础对企业进行信用调查和风险评估,决定是否给予信贷支持以及贷款额度、利率等条件。统一社会信用代码还可用于金融机构之间的信息共享和风险联防,防范金融风险。
三、如何用C#实现接口调用?
下面我们以阿里云示例代码为例,具体看下C#得实现过程:
接口地址:https://market.aliyun.com/apimarket/detail/cmapi00068870?#sku=yuncode6287000002
//using System.IO;
//using System.Text;
//using System.Net;
//using System.Net.Security;
//using System.Security.Cryptography.X509Certificates;
private const String host = "https://kzcptwo.market.alicloudapi.com";
private const String path = "/company_two/check";
private const String method = "POST";
private const String appcode = "你自己的AppCode";
static void Main(string[] args)
{
String querys = "";
String bodys = "creditCode=creditCode&companyName=companyName&legalPerson=legalPerson";
String url = host + path;
HttpWebRequest httpRequest = null;
HttpWebResponse httpResponse = null;
if (0 < querys.Length)
{
url = url + "?" + querys;
}
if (host.Contains("https://"))
{
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);
httpRequest = (HttpWebRequest)WebRequest.CreateDefault(new Uri(url));
}
else
{
httpRequest = (HttpWebRequest)WebRequest.Create(url);
}
httpRequest.Method = method;
httpRequest.Headers.Add("Authorization", "APPCODE " + appcode);
//根据API的要求,定义相对应的Content-Type
httpRequest.ContentType = "application/x-www-form-urlencoded; charset=UTF-8";
if (0 < bodys.Length)
{
byte[] data = Encoding.UTF8.GetBytes(bodys);
using (Stream stream = httpRequest.GetRequestStream())
{
stream.Write(data, 0, data.Length);
}
}
try
{
httpResponse = (HttpWebResponse)httpRequest.GetResponse();
}
catch (WebException ex)
{
httpResponse = (HttpWebResponse)ex.Response;
}
Console.WriteLine(httpResponse.StatusCode);
Console.WriteLine(httpResponse.Method);
Console.WriteLine(httpResponse.Headers);
Stream st = httpResponse.GetResponseStream();
StreamReader reader = new StreamReader(st, Encoding.GetEncoding("utf-8"));
Console.WriteLine(reader.ReadToEnd());
Console.WriteLine("\n");
}
public static bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
{
return true;
}
成功相应返回结果:
{
"msg": "成功",
"success": true,
"code": 200,
"data": {
"result": 1, //核验结果:0:统一社会信用代码有误,1:一致,2:不一致
"orderNo": "202412012033297338611"
}
}