# 实名认证示例
# 服务场景描述
实名认证服务通过调用创建账户、实名认证、申请数字证书等API完成实名认证以及申请数字证书功能的调用,满足用户实名认证需求。如图所示:
# 服务调用流程
# 1.本服务调用依赖以下API:
# 2.服务调用前置条件:
创建应用,获取appkey、appsecret;
获取服务调用token;
开通服务,scope授权通过;
以上步骤可参考前置准备
# 3.具体调用步骤
step1:创建账户
以个人账户为例:
# 调用创建个人用户接口(注意请求头部authorization字段=["Bearer "+token]):
curl -X POST "https://apigate.glodon.com/b-trust-test/api/v2/account/person" -H \
"accept: application/json;charset=UTF-8" -H "authorization: Bearer cn-3a9e951a-14ea-452a-9768-306beb5e89d1" -H \
"Content-Type: application/json" -d "{ \"name\": \"张三\", \"idNum\": 430103199904052900, \"mobile\": 13912345178}"
# 接口调用返回:
{
"code": "10000",
"data": {
"accountId": "acct120901867004755968" //生成的账户ID
},
"message": "成功"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
step2:实名认证
以个人手机三要素认证为例:
# 调用个人手机三要素实名认证接口:
curl -X POST "https://apigate.glodon.com/b-trust-test/api/v2/identify/person/3/async" -H \
"accept: application/json;charset=UTF-8" -H "authorization: Bearer cn-3a9e951a-14ea-452a-9768-306beb5e89d1" -H \
"Content-Type: application/json" -d "{ \"accountId\": \"acct120901867004755968\", \"name\": \"张三\", \"idNum\": \
430103199904052900, \"mobile\": 13912345678, \"returnUrl\": \"http:///114.115.148.211:8900/swagger-ui.html\"}"
# 接口调用返回:
{
"code": "10000",
"data": {
//获取实名认证URL
"url": "https://realnameverify-test.fadada.com/fddAuthenticationService/v1/api/synsAuthentication.action?transaction_no=27B0911A9C4FA75D662BD691C242602AED5F722F8BF86196F4F9ABF13AB6CC899A4925D1F385E991&sign=RENCNkEwRjYwRjA4MDBCNjc5OUQ5RTQxM0Y4Njc5NjE5OUM0N0JGNA==&app_id=402558×tamp=1590736765455"
},
"message": "成功"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
step3:填写实名信息
获取到实名认证URL后在浏览器中打开,再扫码页面上二维码进行实名认证。具体步骤如下:
注意
如果是企业实名认证,信息填写步骤如下:
1、管理员认证
2、填写企业信息
3、上传证件
4、对公打款
step4:申请数字证书
实名认证通过的个人或企业可以申请数字证书。
# 调用申请数字证书接口:
curl -X POST "https://apigate.glodon.com/b-trust-test/api/v2/account/apply/cert" -H \
"accept: application/json;charset=UTF-8" -H "authorization: Bearer cn-3a9e951a-14ea-452a-9768-306beb5e89d1" -H \
"Content-Type: application/json" -d "{ \"accountId\": \"acct97713983829573632\"}"
# 接口调用返回:
{
"code": 10000,
"message": "成功",
"data": {
"accountId": "acct1155782836133822465",
"certId": "cert3456783650364543" //证书id
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14