Skip to content

GetCardInfo 查询卡密信息

卡密查询入口:用卡密(可选传机器码)查询卡密的当前状态、到期时间、激活时间与绑定设备信息。

项目
actionGetCardInfo
入口Handle POST https://www.a7p.cn/api/verify/{ApiPassword}
是否计入验证统计

调用步骤

  1. 完成 Init 握手,拿到 ApiPassword
  2. 拼接明文:action=GetCardInfo&Card=卡密;可追加 &Mac=机器码 精确查询该机器上的激活记录。
  3. RC4 加密 + MD5 签名,POST 到 Handle 接口。
  4. code == 200 → 读取 data 中的卡密信息。

请求参数

字段类型必填说明
actionstring固定值 GetCardInfo
Cardstring卡密字符串。等价别名:card
Macstring机器码;传入时优先查该机器上的激活记录。等价别名:mac

明文示例:

text
# 查询卡密整体信息
action=GetCardInfo&Card=6PCG-ZRSZ-EX83-YBEH

# 指定机器码查询
action=GetCardInfo&Card=6PCG-ZRSZ-EX83-YBEH&Mac=MAC001

业务规则

  • Card 必填,缺失返回 1013
  • 卡密不存在或不属于当前产品返回 1004
  • 未传 Mac 时取该卡密最近一条激活记录;传了 Mac 则取对应机器的激活记录。

请求示例

python
# 复用 /api/handle 页面中的 handle() 与 rc4() 函数
API_PW = "A1B2C3D4E5F6G7H8I9J0K1L2M3N4O5P6"

plain = "action=GetCardInfo&Card=6PCG-ZRSZ-EX83-YBEH&Mac=MAC001"
result = handle(API_PW, plain)

code = result["code"]
if code == 200:
    d = result["data"]
    print(f"状态: {d['card_status']}  到期: {d['expire_at']}  设备: {d.get('device_name','')}")
elif code == 1004:
    print("卡密无效")
else:
    print(f"查询失败 {code}: {result['message']}")
csharp
// 复用 /api/handle 页面中的 A7Client
var client = new A7Client(apiPassword);

string plain = "action=GetCardInfo&Card=6PCG-ZRSZ-EX83-YBEH&Mac=MAC001";
JsonElement result = await client.HandleAsync(plain);

int code = result.GetProperty("code").GetInt32();
switch (code)
{
    case 200:
        JsonElement d = result.GetProperty("data");
        Console.WriteLine($"状态: {d.GetProperty("card_status").GetString()}  到期: {d.GetProperty("expire_at").GetString()}");
        break;
    case 1004:
        Console.WriteLine("卡密无效");
        break;
    default:
        Console.WriteLine($"查询失败 {code}: {result.GetProperty("message").GetString()}");
        break;
}
javascript
// 复用 /sdk/nodejs 中的 A7Client
const client = new A7Client({ appId: '150018', appKey: 'YOUR_APP_KEY' })
await client.init()

const result = await client.call('GetCardInfo', {
  Card: '6PCG-ZRSZ-EX83-YBEH',
  Mac: 'MAC001',
})

if (result.code === 200) {
  console.log('状态:', result.data.card_status, '到期:', result.data.expire_at)
} else if (result.code === 1004) {
  console.log('卡密无效')
} else {
  console.error(`查询失败 ${result.code}: ${result.message}`)
}
text
.版本 2

.子程序 A7_查询卡密, 逻辑型
.参数 ApiPassword, 文本型
.参数 卡密, 文本型
.局部变量 TimeStamp, 文本型
.局部变量 加密参数, 文本型
.局部变量 Sign, 文本型
.局部变量 返回文本, 文本型
.局部变量 状态码, 文本型

TimeStamp = 到文本 (时间_取现行时间戳 ())
加密参数 = RC4加密 (ApiPassword, "action=GetCardInfo&Card=" + 卡密)
Sign = 取数据摘要 (到字节集 (ApiPassword + TimeStamp + 加密参数))
返回文本 = 到文本 (网页_访问 ("https://www.a7p.cn/api/verify/" + ApiPassword, 1, "TimeStamp=" + TimeStamp + "&Sign=" + Sign + "&Data=" + 加密参数))

状态码 = JSON_解析 (返回文本, "code")
.判断开始 (状态码 = "200")
    信息框 ("状态:" + JSON_解析 (返回文本, "data.card_status"), 0, )
.判断 (状态码 = "1004")
    信息框 ("卡密无效", 0, )
.默认
    信息框 ("查询失败:" + JSON_解析 (返回文本, "message"), 0, )
.判断结束
返回 (假)

成功响应

json
{
  "code": 200,
  "message": "success",
  "data": {
    "card_status": "active",
    "expire_at": "2026-09-01 12:00:00",
    "activated_at": "2026-03-01 12:00:00",
    "device_id": "MAC001",
    "device_name": "WIN-PC"
  }
}
字段类型说明
card_statusstring卡密状态:active = 已激活、expired = 已过期、disabled = 已禁用
expire_atstring到期时间 YYYY-MM-DD HH:mm:ss
activated_atstring首次激活时间;未激活时为空字符串
device_idstring绑定机器码,无则空字符串
device_namestring绑定设备名称,无则空字符串

失败响应

json
{ "code": 1013, "message": "Card 参数必填", "data": null }
json
{ "code": 1004, "message": "卡密无效", "data": null }

错误码

错误码含义解决方案
1013参数不完整Card 必填
1004卡密无效卡密不存在或不属于当前产品

完整列表见错误码对照表

相关文档

A7验证 · 软件授权与网络验证平台