第三方语音设备可通过绑定的方式与涂鸦云房屋进行绑定,绑定后可通过语音开放api实现对房屋下设备智能化控制。
API 列表
请求方式 |
API |
描述 |
GET |
/v1.0/osaas/voice/brands |
获取语音品牌列表 |
GET |
/v1.0/osaas/projects/{project_id}/room/voice/relations |
分页查询项目房屋与语音设备绑定关系列表 |
POST |
/v1.0/osaas/rooms/{room_id}/voice/relation |
创建房屋与语音设备绑定关系 |
PUT |
/v1.0/osaas/rooms/{room_id}/voice/relations/{relation_id} |
修改房屋与语音设备绑定关系 |
DELETE |
/v1.0/osaas/rooms/{room_id}/voice/relations/{relation_id} |
删除房屋与语音设备绑定关系 |
PUT |
/v1.0/osaas/projects/{project_id}/third-party/voice/authorization |
批量修改第三方语音云平台授权凭证 |
DELETE |
/v1.0/osaas/projects/{project_id}/third-party/voice/authorization |
批量清除第三方语音云平台授权凭证 |
获取语音品牌列表
接口描述
获取语音品牌列表
接口地址
GET /v1.0/osaas/voice/brands
响应参数
参数名 |
类型 |
说明 |
code |
Integer |
响应码(详情见错误码章节),成功时为空 |
success |
Boolean |
是否成功:(true:成功,false:失败) |
msg |
String |
请求失败的信息,成功时为空 |
t |
Long |
返回时间戳,13位 |
result |
Array |
三方语音品牌列表 |
result参数说明
参数名 |
类型 |
说明 |
brand_id |
String |
语音品牌唯一标识 |
brand_name |
String |
语音品牌名称 |
请求示例
GET {url}/v1.0/osaas/voice/brands
响应成功示例
{
"success": true,
"t": 1566053034624,
"result": [
{
"brand_id": "33",
"brand_name": "*** 音箱"
}
]
}
响应失败示例
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
分页查询项目房屋与语音设备绑定关系列表
接口描述
调用该接口分页查询项目房屋与语音设备绑定关系列表
接口地址
GET /v1.0/osaas/projects/{project_id}/room/voice/relations
请求参数
参数名 |
类型 |
参数类型 |
说明 |
是否必需 |
project_id |
String |
URI |
项目唯一标识 |
Yes |
page_no |
Integer |
URL |
页码(page_no>0),默认1 |
No |
page_size |
Integer |
URL |
页条数(0<page_size<100),默认20 |
No |
响应参数
参数名 |
类型 |
说明 |
code |
Integer |
响应码(详情见错误码章节),成功时为空 |
success |
Boolean |
是否成功:(true:成功,false:失败) |
msg |
String |
请求失败的信息,成功时为空 |
t |
Long |
返回时间戳,13位 |
result |
Object |
项目房屋与语音设备关系列表结果 |
result参数说明
参数名 |
类型 |
说明 |
total |
Integer |
总条数 |
page_no |
Integer |
页码 |
page_size |
Integer |
页条数 |
relations |
Arrays |
房屋与语音设备关系列表 |
relations参数说明
参数名 |
类型 |
说明 |
relation_id |
String |
关系唯一标识 |
brand_id |
String |
语音品牌唯一标识 |
room_id |
String |
房屋唯一标识 |
voice_id |
String |
三方语音设备唯一标识 |
gmt_create |
Long |
创建时间 |
gmt_modified |
Long |
修改时间 |
请求示例
GET {url}/v1.0/osaas/projects/12338239650******/room/voice/relations
响应成功示例
{
"result": {
"total": 1,
"page_no": 1,
"page_size": 20,
"relations": [
{
"relation_id": "1233965053******",
"brand_id": "33",
"room_id": "12156722******",
"voice_id": "************",
"gmt_create": 1559707046000,
"gmt_modified": 1559707046000
}
]
},
"success": true,
"t": 1572936751228
}
响应失败示例
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
创建房屋与语音设备绑定关系
接口描述
调用该接口创建房屋与语音设备绑定关系
接口地址
POST /v1.0/osaas/rooms/{room_id}/voice/relation
请求参数
参数名 |
类型 |
参数类型 |
说明 |
是否必需 |
room_id |
String |
URI |
房屋唯一标识 |
Yes |
voice_id |
String |
BODY |
语音设备唯一标识 |
Yes |
brand_id |
String |
BODY |
语音品牌唯一标识 |
Yes |
响应参数
参数名 |
类型 |
说明 |
code |
Integer |
响应码(详情见错误码章节),成功时为空 |
success |
Boolean |
是否成功:(true:成功,false:失败) |
msg |
String |
请求失败的信息,成功时为空 |
t |
Long |
返回时间戳,13位 |
result |
String |
房屋与语音设备绑定关系唯一标识 |
请求示例
POST {url}/v1.0/osaas/rooms/123382396******/voice/relation
{
"voice_id": "************",
"brand_id": "33"
}
响应成功示例
{
"success": true,
"result": "11123823************",
"t": 1566053034624
}
响应失败示例
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
修改房屋与语音设备绑定关系
接口描述
调用该接口修改房屋与语音设备绑定关系
接口地址
PUT /v1.0/osaas/rooms/{room_id}/voice/relations/{relation_id}
请求参数
参数名 |
类型 |
参数类型 |
说明 |
是否必需 |
room_id |
String |
URI |
房屋唯一标识 |
是 |
relation_id |
String |
URI |
关系唯一标识 |
是 |
voice_id |
String |
BODY |
语音设备唯一标识 |
否 |
brand_id |
String |
BODY |
语音品牌唯一标识 |
否 |
响应参数
参数名 |
类型 |
说明 |
code |
Integer |
响应码(详情见错误码章节),成功时为空 |
success |
Boolean |
是否成功:(true:成功,false:失败) |
msg |
String |
请求失败的信息,成功时为空 |
t |
Long |
返回时间戳,13位 |
result |
Boolean |
操作结果 |
请求示例
PUT {url}/v1.0/osaas/rooms/1233823******/voice/relations/178******
{
"voice_id": "************",
"brand_id": "33"
}
响应成功示例
{
"success": true,
"result": true,
"t": 1566053034624
}
响应失败示例
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
删除房屋与语音设备绑定关系
接口描述
调用该接口删除房屋与语音设备绑定关系
接口地址
DELETE /v1.0/osaas/rooms/{room_id}/voice/relations/{relation_id}
请求参数
参数名 |
类型 |
参数类型 |
说明 |
是否必需 |
room_id |
String |
URI |
房屋唯一标识 |
是 |
relation_id |
String |
URI |
关系唯一标识 |
是 |
响应参数
参数名 |
类型 |
说明 |
code |
Integer |
响应码(详情见错误码章节),成功时为空 |
success |
Boolean |
是否成功:(true:成功,false:失败) |
msg |
String |
请求失败的信息,成功时为空 |
t |
Long |
返回时间戳,13位 |
result |
Boolean |
操作结果 |
请求示例
DELETE {url}/v1.0/osaas/rooms/123382396******/voice/relations/178******
响应成功示例
{
"success": true,
"result": true,
"t": 1566053034624
}
响应失败示例
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
设置第三方语音开放平台授权凭证
接口描述
调用该接口设置第三方语音开放平台授权凭证,按项目维度,目前仅有百度音箱支持
接口地址
PUT /v1.0/osaas/projects/{project_id}/third-party/voice/authorization
请求参数
参数名 |
类型 |
参数类型 |
说明 |
是否必需 |
project_id |
String |
URI |
项目唯一标识 |
是 |
brand_id |
String |
BODY |
语音品牌唯一标识 |
是 |
app_id |
String |
BODY |
应用唯一标识 |
是 |
app_secret |
String |
BODY |
应用密钥 |
是 |
响应参数
参数名 |
类型 |
说明 |
code |
Integer |
响应码(详情见错误码章节),成功时为空 |
success |
Boolean |
是否成功:(true:成功,false:失败) |
msg |
String |
请求失败的信息,成功时为空 |
t |
Long |
返回时间戳,13位 |
result |
Boolean |
操作结果 |
请求示例
PUT {url}/v1.0/osaas/projects/12338239650******/dueros/voice/authorization
{
"brand_id": "33",
"app_id": "************",
"app_secret": "************"
}
响应成功示例
{
"success": true,
"result": true,
"t": 1566053034624
}
响应失败示例
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
批量清除第三方语音云平台授权凭证
接口描述
调用该接口批量清除第三方语音云平台授权凭证,按项目维度,目前仅有百度 音箱支持
接口地址
DELETE /v1.0/osaas/projects/{project_id}/third-party/voice/authorization
请求参数
参数名 |
类型 |
参数类型 |
说明 |
是否必需 |
project_id |
String |
URI |
项目唯一标识 |
是 |
brand_id |
String |
URL |
语音品牌唯一标识 |
是 |
响应参数
参数名 |
类型 |
说明 |
code |
Integer |
响应码(详情见错误码章节),成功时为空 |
success |
Boolean |
是否成功:(true:成功,false:失败) |
msg |
String |
请求失败的信息,成功时为空 |
t |
Long |
返回时间戳,13位 |
result |
Boolean |
操作结果 |
请求示例
DELETE {url}/v1.0/osaas/projects/1233823965******/third-party/voice/authorization?brand_id=33
响应成功示例
{
"success": true,
"result": true,
"t": 1566053034624
}
响应失败示例
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
错误码
以下为该接口常见的业务异常,更多的异常错误,请参见全局错误码。