Skip to content

检查更新 POST

比较客户端版本号与服务器最新版本,如有更新则返回更新信息和下载地址。

请求方法: POST  Content-Type: application/x-www-form-urlencoded

💡 SDK 快速接入

官方 SDK 已支持此接口,您可以直接使用 SDK 一键调用,无需手动处理加密和签名。

对接示例也已支持此接口

SDK 调用示例

python
result = verify.check_update('1000')
if result['success'] and result.get('has_update'):
    print(f"最新版本: {result['ver']}")
    print(f"下载地址: {result.get('upurl', '')}")
javascript
const result = await verify.checkUpdate('1000');
if (result.success && result.has_update) {
    console.log(`最新版本: ${result.ver}`);
}
java
T3Verify.T3Result result = verify.checkUpdate("1000");
if (result.success) System.out.println(result.msg);
csharp
var result = verify.CheckUpdate("1000");
if (result.Success) Console.WriteLine(result.Msg);
php
$result = $verify->checkUpdate('1000');
if ($result['success']) echo $result['msg'] . "\n";

请求参数

参数类型必填说明
verstring必填客户端当前版本号
tnumber条件必填秒级 Unix 时间戳
sstring条件必填请求签名
safe_codestring可选数据验证码

成功响应

jsonc
{
  "code": "200",                                         // 状态码
  "ver": "v2.0",                                         // 最新版本显示名
  "version": "2.0.0",                                    // 最新版本号(用于比较)
  "uplog": "1. 修复了已知 bug\n2. 新增用户中心",            // 更新公告
  "upurl": "https://example.com/download/v2.0.apk"       // 更新下载地址
}
txt
需要更新
最新版本:v2.0
最新版本号:2.0.0
更新公告:1. 修复了已知 bug
更新地址:https://example.com/download/v2.0.apk

已是最新版

如果客户端版本号与后台设置一致,将返回 code: "201"msg: "已是最新版"

错误列表

错误消息原因
版本号为不可空未传 ver 参数
已是最新版版本号与后台一致
程序未开启 / 接口未开启程序或接口未启用
时间戳参数不可为空开启时间戳验证但未传 t
验证数据已失效,请重试时间戳校验失败(排障指南
签名参数不可为空开启签名验证但未传 s
签名有误签名校验失败

T3 网络验证 WebAPI 开发文档