鉴权方式(所有接口通用)
每个请求携带 3 个请求头,用你的 API Secret 计算 HMAC-SHA256 签名。
| 请求头 | 说明 |
X-API-Key | 你的 API Key |
X-Timestamp | 当前 Unix 秒级时间戳(±5 分钟内有效) |
X-Signature | 签名(见下方算法) |
签名算法
signature = HMAC-SHA256(api_secret, method + path + query_string + timestamp + body)
# GET 请求 body 为空字符串
# 示例:GET /api/gps/latest?device_sn=TP-001
# 消息 = "GET" + "/api/gps/latest" + "device_sn=TP-001" + "1750000000" + ""
GET /api/gps/latest —— 查询设备最新位置
| 参数 | 类型 | 必填 | 说明 |
| device_sn | string | 是 | 设备 SN |
返回:{"code":0,"data":{"deviceSn","longitude","latitude","speed","direction","time"}}