简单实用的激活码管理功能
几行代码即可集成激活码验证功能
POST/api/client/activateContent-Type: application/jsonX-API-Key: your-api-key-here{"code":"U2m9Lw2cjOaV8WQDx3Hy","device_id":"unique-device-id"}
HTTP/1.1 200 OKContent-Type: application/json{"success":true,"message":"激活成功","data": {"code":"U2m9Lw2cjOaV8WQDx3Hy","device_id":"unique-device-id","activated_at":"2024-01-15 10:30:00","expires_at":"2024-02-14 10:30:00","license_token":"eyJhbGc..."}}
HTTP/1.1 400 Bad RequestContent-Type: application/json{"success":false,"message":"该设备已激活,每个设备只能同时使用一个激活码","error_code":"DEVICE_ALREADY_ACTIVATED"}
常见错误码:
DEVICE_ALREADY_ACTIVATED- 设备已激活CODE_ALREADY_USED- 激活码已被使用CODE_EXPIRED- 激活码已过期CODE_NOT_FOUND- 激活码不存在HTTPS 加密传输,防重放攻击
平均响应时间 100ms
RESTful 设计,支持所有语言