单码心跳验证 POST
单码卡密登录后定期调用,维持在线状态。超时未调用将被视为离线。请求方法: POST Content-Type: application/x-www-form-urlencoded
SDK 调用示例
PythonNode.jsJavaC#C++PHPSwiftpython
result = verify.heartbeat(card, statecode)
if result['success']:
print("心跳验证成功")
javascript
const result = await verify.heartbeat(card, statecode);
if (result.success) console.log('心跳验证成功');
java
T3Verify.T3Result result = verify.heartbeat(card, statecode);
if (result.success) System.out.println("心跳验证成功");
csharp
var result = verify.Heartbeat(card, statecode);
if (result.Success) Console.WriteLine("心跳验证成功");
cpp
auto result = verify.heartbeat(card, statecode);
if (result.success) std::cout << "心跳验证成功" << std::endl;
php
$result = $verify->heartbeat($card, $statecode);
if ($result['success']) echo "心跳验证成功\n";
swift
let result = verify.heartbeat(kami: card, statecode: statecode)
if result.success { print("心跳验证成功") }
调用时机登录成功后,按「登录状态码有效期」内定期调用。建议间隔为有效期的 1/2 ~ 2/3。例如有效期为 60 秒,则每 30 ~ 40 秒调用一次。
请求参数
statecode | string | 必填 | 登录时返回的 statecode 值(32 位字符串) |
成功响应
JSON 格式文本格式jsonc
{
"code": "200", // 状态码
"msg": "在线", // 结果消息
"time": 1741700000, // 服务器时间戳
"date": "202603111200" // 服务器日期分钟
}
txt
在线
当前时间:202603111200
当前时间戳:1741700000
错误列表
心跳错误
状态码不存在 | statecode 长度不是 32 位 |
登录状态不存在 | statecode 在心跳记录中不存在 |
通用错误