身份证实名认证接口如何调用?翔云人工智能开放平台了解到,越来越多的企业用户需要集成身份证实名认证接口,但在实现功能的过程中,总会遇到各种各样的问题,对此翔云提供了当下主流语言的调用代码示例,下载即可集成!
以下是基于ios的身份证核验接口调用代码示例:
import Alamofire
class Sample {
func performNetworkRequest() {
let parameters: [String: Any] = [
"img": "/9j",
"key": "M***********g",
"secret": "3***********6",
"typeId": "3003",
"trueName": "陈**",
"idenNo": "13***************3",
"format": "json"
]
AF.request("https://netocr.com/verapi/veriden.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()