设备开放接口
设备 OpenAPI 使用租户开发密钥鉴权。服务端根据 Authorization 中的 api_key 确认租户,接口不接收 app_id 或 tenant 作为数据范围。
批量绑定设备
通过生产授权校验码批量绑定设备。服务端会校验 api_key 所属租户与校验码所属租户一致;测试授权只允许在控制台内维护。
POST https://aikit.xfyun.cn/v1/open/device/authorize
Authorization: Bearer API_KEY
Content-Type: application/json
{
"checkCode": "LICENSE-CHECK-CODE",
"snList": [
"DEVICE-SN-001",
"DEVICE-SN-002"
]
}
返回:
{
"code": 200,
"msg": "success",
"data": {
"total": 2,
"successCount": 1,
"failCount": 1,
"successList": [
{
"sn": "DEVICE-SN-001",
"status": "bound"
}
],
"failList": [
{
"sn": "DEVICE-SN-002",
"reason": "device.not_found"
}
]
}
}
查询注册激活状态
查询当前 api_key 所属租户在日期范围内注册的设备,以及设备是否已激活。
GET https://aikit.xfyun.cn/v1/open/device/registration-activation?startDate=2026-06-01&endDate=2026-06-18
Authorization: Bearer API_KEY
返回:
{
"code": 200,
"msg": "success",
"data": [
{
"sn": "DEVICE-SN-001",
"name": "客厅音箱-001",
"registeredAt": "2026-06-01 08:00:00",
"activated": true,
"activatedAt": "2026-06-01 08:10:00"
}
]
}
校验设备 SN 是否激活
校验当前 api_key 所属租户下指定设备 SN 的激活状态。设备不存在或尚未激活时返回 false。
GET https://aikit.xfyun.cn/v1/open/device/activation?sn=DEVICE-SN-001
Authorization: Bearer API_KEY
返回:
{
"code": 200,
"msg": "success",
"data": true
}