身份证信息核验是实名认证中一种常见的认证方式,它通过比对用户提交的身份证信息与权威数据库中的信息,来确认用户身份是否真实有效,一般情况下,线上平台实现实名认证功能主要依赖于调用第三方接口平台来实现。
实名认证接口费用通常由提供该服务的第三方平台来设定,以翔云实名认证接口为例,不同的服务提供上提供的收费标准均有所不同:
以C++身份证实名认证接口代码为例:
#include
#include
#include
int main() {
// 创建 HTTP 客户端
web::http::client::http_client client(U("https://netocr.com/verapi/veriden.do"));
// 构建请求内容
web::http::multipart_content content;
content.add(web::http::name(U("img")), web::http::value(U("/9j")));
content.add(web::http::name(U("key")), web::http::value(U("M***********g")));
content.add(web::http::name(U("secret")), web::http::value(U("3***********6")));
content.add(web::http::name(U("typeId")), web::http::value(U("3003")));
content.add(web::http::name(U("trueName")), web::http::value(U("陈**")));
content.add(web::http::name(U("idenNo")), web::http::value(U("13***************3")));
content.add(web::http::name(U("format")), web::http::value(U("json")));
// 创建 HTTP 请求
web::http::http_request request(web::http::methods::POST);
request.headers().set_content_type(U("multipart/form-data; boundary=") + content.boundary());
request.set_body(content);
// 发送请求并获取响应
web::http::http_response response = client.request(request).get();
// 确保请求成功
if (response.status_code() == web::http::status_codes::OK) {
// 读取响应内容
std::wstring responseString = response.extract_string().get();
std::wcout << "Response: " << responseString << std::endl;
} else {
std::cerr << "Request failed with status code " << response.status_code() << std::endl;
}
return 0;
}
身份证实名认证的过程是当用户在网站或者应用上进行注册或者登录时,要求输入身份证号、姓名有的还需要提供证件人像和现场人像进行核验,如果信息匹配则返回成功的结果,如果信息不匹配,则返回不一致的结果。