【iOS 接口对接】身份核验实名API接口返回值参数与状态码说明

身份证核验API广泛应用于金融风控、在线教育、医疗健康、共享经济等领域。例如,在金融风控中,可以快速验证用户身份,降低信贷风险;在在线教育中,确保学员身份信息准确无误,满足教育政策要求。该功能接口一般由第三方平台来提供,如翔云、阿里云等。

身份证实名认证接口返回值参数说明:

|----|----------------------|--------|---|---|
| 序号 | 名称 | 类型 | 说明 ||
| 1 | verify_result_status | String | 身份信息核验结果 1:判定为同一人 2:判定为不同人 3:不确定是否为同一人 4:姓名与身份号码不匹配 5:库中无照片 6:库中无此号 7:图片不合格 8:姓名、身份证号码格式不规范 ||
| 2 | verify_similarity | String | 比对值 0 < verify_similarity ≤ 60:判定为不同人 60 < verify_similarity ≤ 70:不确定是否为同一人 70 < verify_similarity:判定为同一人 ||

身份证实名认证接口状态码说明:

|---|---|------|---|---|
| status || code | message ||
| status || 0 | 调用成功(扣费) ||
| status || 400 | 参数缺失 ||
| status || 410 | 参数无法解析 ||
| status || 420 | 传入参数错误 ||
| status || 999 | 服务器错误 ||

iOS身份核验对接示例:

复制代码
import Alamofire

class Sample {

    func performNetworkRequest() {
        let parameters: [String: Any] = [
            "img": "/9j",
            "key": "M***********g",
            "secret": "3***********6",
            "typeId": "3013",
            "trueName": "陈**",
            "idenNo": "13***************3",
            "format": "json"
        ]

        AF.request("https://netocr.com/verapi/veridenOrd.do", method: .post, parameters: parameters)
            .response { response in
                switch response.result {
                case .success(let responseData):
                    if let data = responseData {
                        let responseString = String(data: data, encoding: .utf8)
                        print("Response: \(responseString ?? "")")
                    }
                case .failure(let error):
                    print("Error: \(error.localizedDescription)")
                }
            }
    }
}
let sample = Sample()
sample.performNetworkRequest()
相关推荐
kevinli3 天前
available没你想象中的可靠
ios·编译原理
CodeJourney_J4 天前
如何通过SMB协议实现手机共享电脑文件
windows·ios·smb
ipad协议开发4 天前
企业微信iPad协议接口深度解析:技术原理、应用场景与开发实战
ios·企业微信·ipad
千里马-horse4 天前
Building a Simple Engine -- Mobile Development -- Platform considerations
android·ios·rendering·vulkan
systeminof5 天前
全新MacBook发布:苹果公司将 iPhone 芯片带入笔记本时代
ios·iphone
pop_xiaoli5 天前
effective-Objective-C 第四章阅读笔记
笔记·ios·objective-c·cocoa·xcode
前端不太难5 天前
Flutter 适合什么团队?RN / iOS 各自的边界在哪?
flutter·ios
带娃的IT创业者6 天前
解密OpenClaw系列10-OpenClaw系统要求
人工智能·macos·ios·objective-c·ai智能体·智能体开发·openclaw