Logo思云网络服务平台 · API 文档

思云网络服务平台 API 文档

思云网络服务平台提供标准 RESTful API,支持二要素身份校验、人脸核身、企业工商核验、运营商三要素、银行卡要素验证等核心能力,以及邮件推送通信服务。本文档将帮助您快速完成 API 对接。

接口概述

基础信息

项目说明
接口地址https://sms.siyun223.com/api/{action}
请求方式POST
数据格式请求:application/x-www-form-urlencoded,响应:application/json
字符编码UTF-8
签名算法MD5
时间窗口请求 timestamp 与服务器时间差不超过 ±300 秒

通用请求参数

所有接口(除特殊说明外)均需携带以下公共参数:

参数名类型必填说明
appidstring应用 AppID,在控制台创建应用后获取
timestampstringUnix 时间戳(秒级),与服务器时间差不超过 300 秒
noncestring随机字符串,建议 16-32 位,防重放攻击
signstring请求签名,算法见下方签名认证章节

通用响应格式

{
    "code": 0,
    "msg": "success",
    "data": { ... }
}

URL 格式

系统支持两种 URL 格式访问 API,效果完全一致:

伪静态模式(推荐)

POST https://sms.siyun223.com/api/{action}

需要 Nginx 配置 try_files 伪静态规则,路径更简洁美观。

原生参数模式

POST https://sms.siyun223.com/?route=api/{action}

无需任何服务器配置即可使用,兼容性最佳。

两种格式在功能上完全等价,推荐使用伪静态模式。如果您的服务器未配置伪静态,请使用原生参数模式。

签名认证

所有 API 请求必须携带签名参数,用于验证请求合法性。签名算法如下:

签名生成规则

  1. appidtimestampnonceappsecret 四个值按顺序拼接为一个字符串
  2. 对拼接后的字符串进行 MD5 哈希(32 位小写)

签名公式

sign = md5(appid + timestamp + nonce + appsecret)

示例

// 假设参数如下:
appid     = "app_abc123"
timestamp = "1700000000"
nonce     = "a1b2c3d4e5f6"
appsecret = "secret_xyz789"

// 拼接字符串:
raw = "app_abc1231700000000a1b2c3d4e5f6secret_xyz789"

// MD5 哈希:
sign = md5(raw) = "e10adc3949ba59abbe56e057f20f883e"
appsecret 仅用于服务端签名计算,切勿在客户端代码或前端页面中暴露。

IP 白名单

可在控制台为应用配置 IP 白名单。配置后,仅白名单内的 IP 可调用该应用的 API。白名单为空时不做限制。

错误码

当请求失败时,响应中的 code 字段为非零值。以下是完整的错误码列表:

错误码含义说明
0成功请求处理成功
1001签名校验失败sign 参数不正确,请检查签名算法和 appsecret
1002IP 受限请求 IP 不在应用白名单中
1003请求频率超限触发速率限制,请降低请求频率
1004应用无效AppID 不存在、应用已停用、未通过审核或账号被封禁
2001余额不足账户余额不足以支付本次调用费用
2002参数错误缺少必要参数或参数格式不正确
2003服务未启用增值服务未启用,请联系管理员
3001接口异常接口异常请联系管理员
3002认证失败身份校验未通过(姓名与身份证号不匹配等)
3003等待中人脸核身场景下,用户尚未完成操作

二要素身份校验

校验姓名与身份证号是否匹配,实时调用百度云二要素认证接口。

POST https://sms.siyun223.com/api/check2factor

请求参数

参数名类型必填说明
appidstring应用 AppID
timestampstringUnix 时间戳
noncestring随机字符串
signstring请求签名
real_namestring真实姓名
id_cardstring身份证号码(18 位)
out_order_nostring商户订单号,用于对账和防重复提交

成功响应

{
    "code": 0,
    "msg": "认证成功",
    "data": {
        "score": 100
    }
}

失败响应

{
    "code": 3002,
    "msg": "认证失败",
    "data": null
}
调用成功扣费,调用失败(如姓名与身份证不匹配)自动回滚冻结金额,不产生费用。请在调用前确保账户余额充足。

代码示例

$appId     = 'your_app_id';
$appSecret = 'your_app_secret';
$timestamp = (string)time();
$nonce     = bin2hex(random_bytes(16));
$sign      = md5($appId . $timestamp . $nonce . $appSecret);

$ch = curl_init('https://sms.siyun223.com/api/check2factor');
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT        => 30,
    CURLOPT_POSTFIELDS     => http_build_query([
        'appid'        => $appId,
        'timestamp'    => $timestamp,
        'nonce'        => $nonce,
        'sign'         => $sign,
        'real_name'    => '张三',
        'id_card'      => '110101199001011234',
        'out_order_no' => 'ORDER_001',
    ]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
String appId = "your_app_id", appSecret = "your_app_secret";
String timestamp = String.valueOf(System.currentTimeMillis() / 1000);
String nonce = UUID.randomUUID().toString().replace("-", "");
String sign = md5(appId + timestamp + nonce + appSecret);

String body = "appid=" + appId + "&timestamp=" + timestamp
    + "&nonce=" + nonce + "&sign=" + sign
    + "&real_name=" + URLEncoder.encode("张三", "UTF-8")
    + "&id_card=110101199001011234"
    + "&out_order_no=ORDER_001";

HttpRequest req = HttpRequest.newBuilder()
    .uri(URI.create("https://sms.siyun223.com/api/check2factor"))
    .header("Content-Type", "application/x-www-form-urlencoded")
    .POST(HttpRequest.BodyPublishers.ofString(body)).build();
String resp = HttpClient.newHttpClient()
    .send(req, HttpResponse.BodyHandlers.ofString()).body();
import hashlib, time, uuid, requests

app_id, app_secret = 'your_app_id', 'your_app_secret'
timestamp = str(int(time.time()))
nonce = uuid.uuid4().hex
sign = hashlib.md5((app_id + timestamp + nonce + app_secret).encode()).hexdigest()

resp = requests.post('https://sms.siyun223.com/api/check2factor', data={
    'appid': app_id, 'timestamp': timestamp,
    'nonce': nonce, 'sign': sign,
    'real_name': '张三',
    'id_card': '110101199001011234',
    'out_order_no': 'ORDER_001',
})
print(resp.json())
const crypto = require('crypto');
const appId = 'your_app_id', appSecret = 'your_app_secret';
const timestamp = String(Math.floor(Date.now() / 1000));
const nonce = crypto.randomBytes(16).toString('hex');
const sign = crypto.createHash('md5')
    .update(appId + timestamp + nonce + appSecret).digest('hex');

const resp = await fetch('https://sms.siyun223.com/api/check2factor', {
    method: 'POST',
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    body: new URLSearchParams({
        appid: appId, timestamp, nonce, sign,
        real_name: '张三',
        id_card: '110101199001011234',
        out_order_no: 'ORDER_001',
    }).toString(),
});
console.log(await resp.json());

人脸核身 - 创建会话

创建一个人脸核身会话,返回人脸采集页面 URL。将该 URL 发送给终端用户,用户在页面上完成人脸采集后,通过查询结果接口获取核身结果。

POST https://sms.siyun223.com/api/face_init

请求参数

参数名类型必填说明
appidstring应用 AppID
timestampstringUnix 时间戳
noncestring随机字符串
signstring请求签名
real_namestring真实姓名
id_cardstring身份证号码(18 位)
out_order_nostring商户订单号

成功响应

{
    "code": 0,
    "msg": "人脸核身会话创建成功",
    "data": {
        "verify_url": "https://sms.siyun223.com/?route=api/face_capture&token=xxxx",
        "verify_id": "xxxx",
        "log_id": 123
    }
}

响应字段说明

字段类型说明
verify_urlstring人脸采集页面地址,需发送给终端用户在浏览器中打开
verify_idstring核身会话标识,查询结果时使用
log_idint认证记录 ID,查询结果时使用
verify_url 需要在移动端浏览器中打开(需要调用摄像头)。建议通过短信、微信等方式将链接发送给用户。

代码示例

$appId     = 'your_app_id';
$appSecret = 'your_app_secret';
$timestamp = (string)time();
$nonce     = bin2hex(random_bytes(16));
$sign      = md5($appId . $timestamp . $nonce . $appSecret);

$ch = curl_init('https://sms.siyun223.com/api/face_init');
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT        => 30,
    CURLOPT_POSTFIELDS     => http_build_query([
        'appid'        => $appId,
        'timestamp'    => $timestamp,
        'nonce'        => $nonce,
        'sign'         => $sign,
        'real_name'    => '张三',
        'id_card'      => '110101199001011234',
        'out_order_no' => 'ORDER_001',
    ]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
// $result['data']['verify_url'] 发送给用户打开
String body = "appid=" + appId + "&timestamp=" + timestamp
    + "&nonce=" + nonce + "&sign=" + sign
    + "&real_name=" + URLEncoder.encode("张三", "UTF-8")
    + "&id_card=110101199001011234&out_order_no=ORDER_001";

HttpRequest req = HttpRequest.newBuilder()
    .uri(URI.create("https://sms.siyun223.com/api/face_init"))
    .header("Content-Type", "application/x-www-form-urlencoded")
    .POST(HttpRequest.BodyPublishers.ofString(body)).build();
// 响应中 data.verify_url 发送给用户打开
resp = requests.post('https://sms.siyun223.com/api/face_init', data={
    'appid': app_id, 'timestamp': timestamp,
    'nonce': nonce, 'sign': sign,
    'real_name': '张三',
    'id_card': '110101199001011234',
    'out_order_no': 'ORDER_001',
})
# resp.json()['data']['verify_url'] 发送给用户打开
const resp = await fetch('https://sms.siyun223.com/api/face_init', {
    method: 'POST',
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    body: new URLSearchParams({
        appid: appId, timestamp, nonce, sign,
        real_name: '张三',
        id_card: '110101199001011234',
        out_order_no: 'ORDER_001',
    }).toString(),
});
// result.data.verify_url 发送给用户打开

人脸核身 - 查询结果

查询人脸核身会话的处理结果。建议在创建会话后轮询此接口(间隔 3-5 秒),直到获取到最终结果。

POST https://sms.siyun223.com/api/face_result

请求参数

参数名类型必填说明
appidstring应用 AppID
timestampstringUnix 时间戳
noncestring随机字符串
signstring请求签名
verify_idstring核身会话标识(face_init 返回的 verify_id)
log_idint认证记录 ID(face_init 返回的 log_id)

核身通过

{
    "code": 0,
    "msg": "人脸核身通过",
    "data": {
        "score": 80
    }
}

核身未通过

{
    "code": 3002,
    "msg": "人脸核身未通过",
    "data": null
}

等待用户操作

{
    "code": 3003,
    "msg": "用户尚未完成人脸核身",
    "data": null
}
返回 code: 3003 表示用户尚未完成人脸采集,请继续轮询。建议设置最大轮询时间为 5 分钟,超时后提示用户重新发起。

代码示例

// 轮询查询人脸核身结果
$maxWait = 300; // 最多等待5分钟
$start = time();
while (time() - $start < $maxWait) {
    $timestamp = (string)time();
    $nonce = bin2hex(random_bytes(16));
    $sign = md5($appId . $timestamp . $nonce . $appSecret);

    $ch = curl_init('https://sms.siyun223.com/api/face_result');
    curl_setopt_array($ch, [
        CURLOPT_POST           => true,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_POSTFIELDS     => http_build_query([
            'appid'     => $appId,
            'timestamp' => $timestamp,
            'nonce'     => $nonce,
            'sign'      => $sign,
            'verify_id' => $verifyId, // face_init 返回的 verify_id
            'log_id'    => $logId,    // face_init 返回的 log_id
        ]),
    ]);
    $result = json_decode(curl_exec($ch), true);
    curl_close($ch);

    if ($result['code'] !== 3003) break; // 非等待状态,退出轮询
    sleep(3);
}
// 轮询查询(间隔3秒,最多5分钟)
long start = System.currentTimeMillis();
while (System.currentTimeMillis() - start < 300_000) {
    String ts = String.valueOf(System.currentTimeMillis() / 1000);
    String nc = UUID.randomUUID().toString().replace("-", "");
    String sg = md5(appId + ts + nc + appSecret);

    String body = "appid=" + appId + "&timestamp=" + ts
        + "&nonce=" + nc + "&sign=" + sg
        + "&verify_id=" + verifyId + "&log_id=" + logId;

    HttpRequest req = HttpRequest.newBuilder()
        .uri(URI.create("https://sms.siyun223.com/api/face_result"))
        .header("Content-Type", "application/x-www-form-urlencoded")
        .POST(HttpRequest.BodyPublishers.ofString(body)).build();
    String resp = HttpClient.newHttpClient()
        .send(req, HttpResponse.BodyHandlers.ofString()).body();
    // 解析 resp,code != 3003 时退出
    Thread.sleep(3000);
}
import time
# 轮询查询(间隔3秒,最多5分钟)
start = time.time()
while time.time() - start < 300:
    timestamp = str(int(time.time()))
    nonce = uuid.uuid4().hex
    sign = hashlib.md5((app_id + timestamp + nonce + app_secret).encode()).hexdigest()

    resp = requests.post('https://sms.siyun223.com/api/face_result', data={
        'appid': app_id, 'timestamp': timestamp,
        'nonce': nonce, 'sign': sign,
        'verify_id': verify_id, # face_init 返回
        'log_id': log_id,       # face_init 返回
    })
    result = resp.json()
    if result['code'] != 3003: break
    time.sleep(3)
// 轮询查询(间隔3秒,最多5分钟)
const start = Date.now();
while (Date.now() - start < 300000) {
    const ts = String(Math.floor(Date.now() / 1000));
    const nc = crypto.randomBytes(16).toString('hex');
    const sg = crypto.createHash('md5')
        .update(appId + ts + nc + appSecret).digest('hex');

    const resp = await fetch('https://sms.siyun223.com/api/face_result', {
        method: 'POST',
        headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
        body: new URLSearchParams({
            appid: appId, timestamp: ts, nonce: nc, sign: sg,
            verify_id: verifyId, log_id: logId,
        }).toString(),
    });
    const result = await resp.json();
    if (result.code !== 3003) break;
    await new Promise(r => setTimeout(r, 3000));
}

人脸核身 - 对接时序

人脸核身采用异步模式,完整对接流程如下:

1
调用 face_init 创建会话

服务端携带 real_name、id_card、out_order_no 调用 /api/face_init,获取 verify_url、verify_id、log_id。

2
将 verify_url 发送给终端用户

通过短信、微信、App 内嵌 WebView 等方式将人脸采集链接发送给用户。

3
用户完成人脸采集

用户在浏览器中打开链接,授权摄像头,完成活体检测和人脸拍照。系统自动将人脸照片与身份证信息进行比对。

4
轮询 face_result 获取结果

服务端以 3-5 秒间隔轮询 /api/face_result,传入 verify_id 和 log_id。当 code 为 0(通过)或 3002(未通过)时停止轮询。

5
处理业务逻辑

根据核身结果执行后续业务操作(如开通服务、完成注册等)。

企业三要素验证

校验企业名称、统一社会信用代码、法人姓名三要素是否匹配,实时比对工商数据库。适用于企业入驻审核、供应商资质核验等场景。

POST https://sms.siyun223.com/api/enterprise_3factor

请求参数

参数名类型必填说明
appidstring应用 AppID
timestampstringUnix 时间戳
noncestring随机字符串
signstring请求签名
company_namestring企业名称
credit_nostring统一社会信用代码(18 位)
legal_personstring法人代表姓名
out_order_nostring商户订单号,用于对账和防重复提交

成功响应

{
    "code": 0,
    "msg": "企业三要素验证通过",
    "data": {
        "match": true
    }
}

验证不通过

{
    "code": 3002,
    "msg": "企业信息不匹配",
    "data": null
}
每次调用无论成功或失败都会产生费用。请在调用前确保账户余额充足或流量包有剩余次数。

代码示例

$ch = curl_init('https://sms.siyun223.com/api/enterprise_3factor');
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT        => 30,
    CURLOPT_POSTFIELDS     => http_build_query([
        'appid'        => $appId,
        'timestamp'    => $timestamp,
        'nonce'        => $nonce,
        'sign'         => $sign,
        'company_name' => '北京思云科技有限公司',
        'credit_no'    => '91110108MA01XXXXX',
        'legal_person' => '张三',
        'out_order_no' => 'ORDER_001',
    ]),
]);
String body = "appid=" + appId + "&timestamp=" + timestamp
    + "&nonce=" + nonce + "&sign=" + sign
    + "&company_name=" + URLEncoder.encode("北京思云科技有限公司", "UTF-8")
    + "&credit_no=91110108MA01XXXXX"
    + "&legal_person=" + URLEncoder.encode("张三", "UTF-8")
    + "&out_order_no=ORDER_001";

HttpRequest req = HttpRequest.newBuilder()
    .uri(URI.create("https://sms.siyun223.com/api/enterprise_3factor"))
    .header("Content-Type", "application/x-www-form-urlencoded")
    .POST(HttpRequest.BodyPublishers.ofString(body)).build();
resp = requests.post('https://sms.siyun223.com/api/enterprise_3factor', data={
    'appid': app_id, 'timestamp': timestamp,
    'nonce': nonce, 'sign': sign,
    'company_name': '北京思云科技有限公司',
    'credit_no': '91110108MA01XXXXX',
    'legal_person': '张三',
    'out_order_no': 'ORDER_001',
})
const resp = await fetch('https://sms.siyun223.com/api/enterprise_3factor', {
    method: 'POST',
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    body: new URLSearchParams({
        appid: appId, timestamp, nonce, sign,
        company_name: '北京思云科技有限公司',
        credit_no: '91110108MA01XXXXX',
        legal_person: '张三',
        out_order_no: 'ORDER_001',
    }).toString(),
});

企业四要素验证

在三要素基础上增加法人身份证号校验,提供更高安全等级的企业身份核验。适用于金融开户、大额交易等高风险场景。

POST https://sms.siyun223.com/api/enterprise_4factor

请求参数

参数名类型必填说明
appidstring应用 AppID
timestampstringUnix 时间戳
noncestring随机字符串
signstring请求签名
company_namestring企业名称
credit_nostring统一社会信用代码(18 位)
legal_personstring法人代表姓名
legal_person_idstring法人身份证号码(18 位)
out_order_nostring商户订单号

成功响应

{
    "code": 0,
    "msg": "企业四要素验证通过",
    "data": {
        "match": true
    }
}

验证不通过

{
    "code": 3002,
    "msg": "企业信息不匹配",
    "data": null
}

代码示例

$ch = curl_init('https://sms.siyun223.com/api/enterprise_4factor');
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT        => 30,
    CURLOPT_POSTFIELDS     => http_build_query([
        'appid'           => $appId,
        'timestamp'       => $timestamp,
        'nonce'           => $nonce,
        'sign'            => $sign,
        'company_name'    => '北京思云科技有限公司',
        'credit_no'       => '91110108MA01XXXXX',
        'legal_person'    => '张三',
        'legal_person_id' => '110101199001011234',
        'out_order_no'    => 'ORDER_001',
    ]),
]);
String body = "appid=" + appId + "&timestamp=" + timestamp
    + "&nonce=" + nonce + "&sign=" + sign
    + "&company_name=" + URLEncoder.encode("北京思云科技有限公司", "UTF-8")
    + "&credit_no=91110108MA01XXXXX"
    + "&legal_person=" + URLEncoder.encode("张三", "UTF-8")
    + "&legal_person_id=110101199001011234"
    + "&out_order_no=ORDER_001";

HttpRequest req = HttpRequest.newBuilder()
    .uri(URI.create("https://sms.siyun223.com/api/enterprise_4factor"))
    .header("Content-Type", "application/x-www-form-urlencoded")
    .POST(HttpRequest.BodyPublishers.ofString(body)).build();
resp = requests.post('https://sms.siyun223.com/api/enterprise_4factor', data={
    'appid': app_id, 'timestamp': timestamp,
    'nonce': nonce, 'sign': sign,
    'company_name': '北京思云科技有限公司',
    'credit_no': '91110108MA01XXXXX',
    'legal_person': '张三',
    'legal_person_id': '110101199001011234',
    'out_order_no': 'ORDER_001',
})
const resp = await fetch('https://sms.siyun223.com/api/enterprise_4factor', {
    method: 'POST',
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    body: new URLSearchParams({
        appid: appId, timestamp, nonce, sign,
        company_name: '北京思云科技有限公司',
        credit_no: '91110108MA01XXXXX',
        legal_person: '张三',
        legal_person_id: '110101199001011234',
        out_order_no: 'ORDER_001',
    }).toString(),
});

运营商三要素验证

校验姓名、身份证号、手机号三要素是否匹配,实时比对运营商数据库。适用于手机号实名绑定、风控反欺诈、用户注册验证等场景。

POST https://sms.siyun223.com/api/carrier_3factor

请求参数

参数名类型必填说明
appidstring应用 AppID
timestampstringUnix 时间戳
noncestring随机字符串
signstring请求签名
namestring真实姓名
idcardstring身份证号码(18 位)
mobilestring手机号码(11 位)
out_order_nostring商户订单号,用于对账和防重复提交

成功响应

{
    "code": 0,
    "msg": "运营商三要素验证通过",
    "data": {
        "match": true
    }
}

验证不通过

{
    "code": 3002,
    "msg": "运营商信息不匹配",
    "data": null
}
每次调用无论成功或失败都会产生费用。请在调用前确保账户余额充足或流量包有剩余次数。

代码示例

$ch = curl_init('https://sms.siyun223.com/api/carrier_3factor');
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT        => 30,
    CURLOPT_POSTFIELDS     => http_build_query([
        'appid'        => $appId,
        'timestamp'    => $timestamp,
        'nonce'        => $nonce,
        'sign'         => $sign,
        'name'         => '张三',
        'idcard'       => '110101199001011234',
        'mobile'       => '13800138000',
        'out_order_no' => 'ORDER_001',
    ]),
]);
String body = "appid=" + appId + "&timestamp=" + timestamp
    + "&nonce=" + nonce + "&sign=" + sign
    + "&name=" + URLEncoder.encode("张三", "UTF-8")
    + "&idcard=110101199001011234"
    + "&mobile=13800138000"
    + "&out_order_no=ORDER_001";

HttpRequest req = HttpRequest.newBuilder()
    .uri(URI.create("https://sms.siyun223.com/api/carrier_3factor"))
    .header("Content-Type", "application/x-www-form-urlencoded")
    .POST(HttpRequest.BodyPublishers.ofString(body)).build();
resp = requests.post('https://sms.siyun223.com/api/carrier_3factor', data={
    'appid': app_id, 'timestamp': timestamp,
    'nonce': nonce, 'sign': sign,
    'name': '张三',
    'idcard': '110101199001011234',
    'mobile': '13800138000',
    'out_order_no': 'ORDER_001',
})
const resp = await fetch('https://sms.siyun223.com/api/carrier_3factor', {
    method: 'POST',
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    body: new URLSearchParams({
        appid: appId, timestamp, nonce, sign,
        name: '张三',
        idcard: '110101199001011234',
        mobile: '13800138000',
        out_order_no: 'ORDER_001',
    }).toString(),
});

银行卡三要素验证

校验姓名、身份证号、银行卡号三要素是否匹配,实时比对银联数据。适用于绑卡验证、开户审核、支付风控等场景。

POST https://sms.siyun223.com/api/bankcard_3factor

请求参数

参数名类型必填说明
appidstring应用 AppID
timestampstringUnix 时间戳
noncestring随机字符串
signstring请求签名
namestring真实姓名
idcardstring身份证号码(18 位)
bankcardstring银行卡号
out_order_nostring商户订单号,用于对账和防重复提交

成功响应

{
    "code": 0,
    "msg": "银行卡三要素验证通过",
    "data": {
        "match": true
    }
}

验证不通过

{
    "code": 3002,
    "msg": "银行卡信息不匹配",
    "data": null
}
每次调用无论成功或失败都会产生费用。请在调用前确保账户余额充足或流量包有剩余次数。

代码示例

$appId     = 'your_app_id';
$appSecret = 'your_app_secret';
$timestamp = (string)time();
$nonce     = bin2hex(random_bytes(16));
$sign      = md5($appId . $timestamp . $nonce . $appSecret);

$ch = curl_init('https://sms.siyun223.com/api/bankcard_3factor');
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT        => 30,
    CURLOPT_POSTFIELDS     => http_build_query([
        'appid'        => $appId,
        'timestamp'    => $timestamp,
        'nonce'        => $nonce,
        'sign'         => $sign,
        'name'         => '张三',
        'idcard'       => '110101199001011234',
        'bankcard'     => '6222021234567890123',
        'out_order_no' => 'ORDER_001',
    ]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
String appId = "your_app_id", appSecret = "your_app_secret";
String timestamp = String.valueOf(System.currentTimeMillis() / 1000);
String nonce = UUID.randomUUID().toString().replace("-", "");
String sign = md5(appId + timestamp + nonce + appSecret);

String body = "appid=" + appId + "&timestamp=" + timestamp
    + "&nonce=" + nonce + "&sign=" + sign
    + "&name=" + URLEncoder.encode("张三", "UTF-8")
    + "&idcard=110101199001011234"
    + "&bankcard=6222021234567890123"
    + "&out_order_no=ORDER_001";

HttpRequest req = HttpRequest.newBuilder()
    .uri(URI.create("https://sms.siyun223.com/api/bankcard_3factor"))
    .header("Content-Type", "application/x-www-form-urlencoded")
    .POST(HttpRequest.BodyPublishers.ofString(body)).build();
String resp = HttpClient.newHttpClient()
    .send(req, HttpResponse.BodyHandlers.ofString()).body();
import hashlib, time, uuid, requests

app_id, app_secret = 'your_app_id', 'your_app_secret'
timestamp = str(int(time.time()))
nonce = uuid.uuid4().hex
sign = hashlib.md5((app_id + timestamp + nonce + app_secret).encode()).hexdigest()

resp = requests.post('https://sms.siyun223.com/api/bankcard_3factor', data={
    'appid': app_id, 'timestamp': timestamp,
    'nonce': nonce, 'sign': sign,
    'name': '张三',
    'idcard': '110101199001011234',
    'bankcard': '6222021234567890123',
    'out_order_no': 'ORDER_001',
})
print(resp.json())
const crypto = require('crypto');
const appId = 'your_app_id', appSecret = 'your_app_secret';
const timestamp = String(Math.floor(Date.now() / 1000));
const nonce = crypto.randomBytes(16).toString('hex');
const sign = crypto.createHash('md5')
    .update(appId + timestamp + nonce + appSecret).digest('hex');

const resp = await fetch('https://sms.siyun223.com/api/bankcard_3factor', {
    method: 'POST',
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    body: new URLSearchParams({
        appid: appId, timestamp, nonce, sign,
        name: '张三',
        idcard: '110101199001011234',
        bankcard: '6222021234567890123',
        out_order_no: 'ORDER_001',
    }).toString(),
});
console.log(await resp.json());

银行卡四要素验证

在银行卡三要素基础上增加预留手机号校验,提供更高安全等级的银行卡身份核验。适用于大额支付、快捷支付绑卡等高风险场景。

POST https://sms.siyun223.com/api/bankcard_4factor

请求参数

参数名类型必填说明
appidstring应用 AppID
timestampstringUnix 时间戳
noncestring随机字符串
signstring请求签名
namestring真实姓名
idcardstring身份证号码(18 位)
bankcardstring银行卡号
mobilestring银行预留手机号(11 位)
out_order_nostring商户订单号

成功响应

{
    "code": 0,
    "msg": "银行卡四要素验证通过",
    "data": {
        "match": true
    }
}

验证不通过

{
    "code": 3002,
    "msg": "银行卡信息不匹配",
    "data": null
}
每次调用无论成功或失败都会产生费用。请在调用前确保账户余额充足或流量包有剩余次数。

代码示例

$appId     = 'your_app_id';
$appSecret = 'your_app_secret';
$timestamp = (string)time();
$nonce     = bin2hex(random_bytes(16));
$sign      = md5($appId . $timestamp . $nonce . $appSecret);

$ch = curl_init('https://sms.siyun223.com/api/bankcard_4factor');
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT        => 30,
    CURLOPT_POSTFIELDS     => http_build_query([
        'appid'        => $appId,
        'timestamp'    => $timestamp,
        'nonce'        => $nonce,
        'sign'         => $sign,
        'name'         => '张三',
        'idcard'       => '110101199001011234',
        'bankcard'     => '6222021234567890123',
        'mobile'       => '13800138000',
        'out_order_no' => 'ORDER_001',
    ]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
String appId = "your_app_id", appSecret = "your_app_secret";
String timestamp = String.valueOf(System.currentTimeMillis() / 1000);
String nonce = UUID.randomUUID().toString().replace("-", "");
String sign = md5(appId + timestamp + nonce + appSecret);

String body = "appid=" + appId + "&timestamp=" + timestamp
    + "&nonce=" + nonce + "&sign=" + sign
    + "&name=" + URLEncoder.encode("张三", "UTF-8")
    + "&idcard=110101199001011234"
    + "&bankcard=6222021234567890123"
    + "&mobile=13800138000"
    + "&out_order_no=ORDER_001";

HttpRequest req = HttpRequest.newBuilder()
    .uri(URI.create("https://sms.siyun223.com/api/bankcard_4factor"))
    .header("Content-Type", "application/x-www-form-urlencoded")
    .POST(HttpRequest.BodyPublishers.ofString(body)).build();
String resp = HttpClient.newHttpClient()
    .send(req, HttpResponse.BodyHandlers.ofString()).body();
import hashlib, time, uuid, requests

app_id, app_secret = 'your_app_id', 'your_app_secret'
timestamp = str(int(time.time()))
nonce = uuid.uuid4().hex
sign = hashlib.md5((app_id + timestamp + nonce + app_secret).encode()).hexdigest()

resp = requests.post('https://sms.siyun223.com/api/bankcard_4factor', data={
    'appid': app_id, 'timestamp': timestamp,
    'nonce': nonce, 'sign': sign,
    'name': '张三',
    'idcard': '110101199001011234',
    'bankcard': '6222021234567890123',
    'mobile': '13800138000',
    'out_order_no': 'ORDER_001',
})
print(resp.json())
const crypto = require('crypto');
const appId = 'your_app_id', appSecret = 'your_app_secret';
const timestamp = String(Math.floor(Date.now() / 1000));
const nonce = crypto.randomBytes(16).toString('hex');
const sign = crypto.createHash('md5')
    .update(appId + timestamp + nonce + appSecret).digest('hex');

const resp = await fetch('https://sms.siyun223.com/api/bankcard_4factor', {
    method: 'POST',
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    body: new URLSearchParams({
        appid: appId, timestamp, nonce, sign,
        name: '张三',
        idcard: '110101199001011234',
        bankcard: '6222021234567890123',
        mobile: '13800138000',
        out_order_no: 'ORDER_001',
    }).toString(),
});
console.log(await resp.json());

查询认证模式

查询当前应用配置的认证模式。可用于客户端动态判断应该调用二要素还是人脸核身接口。

POST https://sms.siyun223.com/api/verify_mode

请求参数

仅需携带公共参数(appid、timestamp、nonce、sign),无额外业务参数。

成功响应

{
    "code": 0,
    "msg": "ok",
    "data": {
        "mode": "2factor"
    }
}

mode 取值说明

说明
2factor二要素身份校验(姓名 + 身份证号)
face人脸核身(姓名 + 身份证号 + 人脸比对)
enterprise_3factor企业三要素验证(企业名称 + 信用代码 + 法人姓名)
enterprise_4factor企业四要素验证(企业名称 + 信用代码 + 法人姓名 + 法人身份证号)
carrier_3factor运营商三要素验证(姓名 + 身份证号 + 手机号)
bankcard_3factor银行卡三要素验证(姓名 + 身份证号 + 银行卡号)
bankcard_4factor银行卡四要素验证(姓名 + 身份证号 + 银行卡号 + 手机号)

代码示例

$appId     = 'your_app_id';
$appSecret = 'your_app_secret';
$timestamp = (string)time();
$nonce     = bin2hex(random_bytes(16));
$sign      = md5($appId . $timestamp . $nonce . $appSecret);

$ch = curl_init('https://sms.siyun223.com/api/verify_mode');
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT        => 30,
    CURLOPT_POSTFIELDS     => http_build_query([
        'appid'     => $appId,
        'timestamp' => $timestamp,
        'nonce'     => $nonce,
        'sign'      => $sign,
    ]),
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
// $result['data']['mode'] => '2factor' | 'face' | 'enterprise_3factor' ...
String appId = "your_app_id", appSecret = "your_app_secret";
String timestamp = String.valueOf(System.currentTimeMillis() / 1000);
String nonce = UUID.randomUUID().toString().replace("-", "");
String sign = md5(appId + timestamp + nonce + appSecret);

String body = "appid=" + appId + "&timestamp=" + timestamp
    + "&nonce=" + nonce + "&sign=" + sign;

HttpRequest req = HttpRequest.newBuilder()
    .uri(URI.create("https://sms.siyun223.com/api/verify_mode"))
    .header("Content-Type", "application/x-www-form-urlencoded")
    .POST(HttpRequest.BodyPublishers.ofString(body)).build();
String resp = HttpClient.newHttpClient()
    .send(req, HttpResponse.BodyHandlers.ofString()).body();
import hashlib, time, uuid, requests

app_id, app_secret = 'your_app_id', 'your_app_secret'
timestamp = str(int(time.time()))
nonce = uuid.uuid4().hex
sign = hashlib.md5((app_id + timestamp + nonce + app_secret).encode()).hexdigest()

resp = requests.post('https://sms.siyun223.com/api/verify_mode', data={
    'appid': app_id, 'timestamp': timestamp,
    'nonce': nonce, 'sign': sign,
})
print(resp.json())
const crypto = require('crypto');
const appId = 'your_app_id', appSecret = 'your_app_secret';
const timestamp = String(Math.floor(Date.now() / 1000));
const nonce = crypto.randomBytes(16).toString('hex');
const sign = crypto.createHash('md5')
    .update(appId + timestamp + nonce + appSecret).digest('hex');

const resp = await fetch('https://sms.siyun223.com/api/verify_mode', {
    method: 'POST',
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    body: new URLSearchParams({
        appid: appId, timestamp, nonce, sign,
    }).toString(),
});
console.log(await resp.json());

计费说明

计费模式

平台支持两种计费方式:

  1. 流量包:用户可在控制台购买对应接口的流量包,调用时优先消耗流量包额度
  2. 按量付费:流量包用完或未购买时,从账户余额按次扣费

扣费流程:每次 API 调用时系统先冻结对应费用,调用成功后确认扣费,失败则回滚冻结金额。

充值方式:支持在线支付和卡密充值。

单价说明

接口说明计费规则
check2factor二要素身份校验按次计费,¥0.2/次,调用成功扣费,失败不计费
face_init人脸核身按次计费,¥0.6/次,调用成功扣费,失败不计费
face_result查询核身结果免费,不产生费用
enterprise_3factor企业三要素验证按次计费,¥0.5/次,调用成功扣费,失败不计费
enterprise_4factor企业四要素验证按次计费,¥0.85/次,调用成功扣费,失败不计费
carrier_3factor运营商三要素验证按次计费,¥0.5/次,调用成功扣费,失败不计费
bankcard_3factor银行卡三要素验证按次计费,¥0.6/次,调用成功扣费,失败不计费
bankcard_4factor银行卡四要素验证按次计费,¥0.8/次,调用成功扣费,失败不计费
verify_mode查询认证模式免费,不产生费用

邮件推送计费

SMTP 邮件推送服务采用独立计费模式,按发送邮件数量计费:

服务说明计费规则
SMTP 邮件推送通过 SMTP 协议发送邮件按封计费,¥0.005/封,发送成功扣费
SMTP 邮件推送通过标准 SMTP 协议对接,非 HTTP API 接口。用户在控制台创建 SMTP 账号后,使用任意邮件客户端或 SMTP 库即可发送邮件,详见控制台使用指南。
余额不足时调用付费接口将返回错误码 2001,请确保账户余额充足。

更新日志

日期版本更新内容
2026-03-07v1.5新增运营商三要素验证、银行卡三要素验证、银行卡四要素验证接口
2026-03-07v1.4新增企业三要素验证、企业四要素验证接口
2026-02-28v1.3新增 SMTP 邮件推送计费说明
2026-02-24v1.2新增卡密充值功能,新增 Node.js 签名示例,完善人脸核身对接时序文档
2026-02-23v1.1新增人脸核身接口(face_init / face_result),新增 verify_mode 接口
2026-02-20v1.0初始版本,支持二要素身份校验

思云智能助手

👋 你好,有什么可以帮你的?

我是思云智能助手,可以回答平台使用、API 接入、
实名认证等相关问题。