【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()
相关推荐
Digitally13 小时前
如何高效地将文件从电脑传输到 iPad:6 种简单方法
ios·电脑·ipad
萤萤七悬18 小时前
【Python笔记】AI帮封装Airtest IOS-WDA touch操作时的factor坐标转换
笔记·python·ios
库奇噜啦呼19 小时前
【iOS】源码学习-锁的原理
学习·ios·cocoa
Digitally19 小时前
如何通过蓝牙将 iPhone 文件传输到电脑?5 种替代方案
ios·电脑·iphone
UXbot20 小时前
移动端UI设计工具选型指南:iOS与Android设计标准支持对比
android·前端·低代码·ios·交互·团队开发·ui设计
不爱记笔记2 天前
苹果WWDC 2026全解析:Apple Intelligence+ 性能提升数据一览
macos·ios·wwdc
00后程序员张2 天前
Jenkins 自动上传 IPA 到 App Store 把发布步骤融入 CI/CD
android·ios·小程序·https·uni-app·iphone·webview
小小程序员mono2 天前
WWDC 2026 之后,M5 桌面 Mac 上市时间预测
macos·ios·wwdc