博瑞智能云音箱云喇叭API开发定时播报文档(2023-4-5)

定时任务
GET 定时播报
POST 定时播报
POST /task.php
Body 请求参数
message: string
m: 0
at: "{% mock 'timestamp'|number(+10) %}"
task_id: string
id: "{{speakerid}}"
token: "{{token}}"
version: "{{version}}"
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| body | body | object | 否 | none |
| » message | body | string | 是 | 播报内容 |
| » m | body | integer | 是 | 0:删除定时任务,1:创建定时任务 |
| » at | body | string | 是 | 任务执行时间 10位时间戳 |
| » task_id | body | string | 否 | 创建定时任务成功后返回的任务ID,删除时必传 |
| » id | body | string | 否 | SPEAKERID ,指该云音箱标签上的的 SN/ID |
| » token | body | string | 是 | 代理商的 token, 预先通过安全渠道分配,使得代理商对该 云音箱 有操作权限 |
| » version | body | string | 是 | 按各型号标注的VERSION版本,由用户配置时选择,预留1-9供选择 |
返回示例
成功
{"errcode": 0,"errmsg": "success","detail": {"task_id": "52b83e069770e05ba0a640e6ae2a010a"}
}
{"errcode": -1,"errmsg": "创建失败,任务时间至少10秒以后","detail": null
}
{"errcode": -1,"errmsg": "删除失败,task_id不正确","detail": null
}
{"errcode": 0,"errmsg": "success","detail": null
}
GET /task.php
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| id | query | string | 是 | 云音箱SN编号 |
| version | query | integer | 是 | version/版本 |
| token | query | string | 是 | none |
| message | query | string | 是 | 播报内容 |
| m | query | integer | 是 | 0:删除定时任务,1:创建定时任务 |
| at | query | string | 是 | 任务执行时间 10位时间戳 |
| task_id | query | string | 否 | 创建定时任务成功后返回的任务ID,删除时必传 |
返回示例
成功
{"errcode": 0,"errmsg": "success","detail": {"task_id": "52b83e069770e05ba0a640e6ae2a010a"}
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | 成功 | Inline |
返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » errcode | integer | true | none | none | |
| » errmsg | string | true | none | none | |
| » detail | object | true | none | none | |
| »» task_id | string | true | none | none |
