Amazon Echo服务

更新时间:2018-08-29 12:57:45

Amazon Echo服务

提供一组对接Amazon Smart Home Skill接口。

发现设备列表

定义描述

path 版本 描述 是否需要用户身份的鉴权
/device/discoverbyecho 1.0.0 Echo发现用户设备

请求参数

参数 类型 必填 描述
accessToken String Oauth2.0 accessToken
oauthOrigin String oauth来源,目前支持OPEN_ACCOUNT

返回参数

参数 类型 必有 描述
deviceList List 设备列表信息

deviceList列表结构</span>

参数 类型 描述
capabilities ​List 设备能力
description ​String 描述
displayCategories ​List ​展示的品类
endpointId ​Integer ​设备iotId
friendlyName ​String ​设备昵称
manufacturerName ​String ​服务提供者

displayCategories列表结构

参数 类型 描述
type ​List 能力类型
version ​String 描述
interface ​List ​能力接口
properties ​Map ​属性

displayCategories列表结构

参数 类型 描述
type ​List 能力类型
version ​String 描述
interface ​List ​能力接口
properties ​Map ​属性

properties结构

参数 类型 描述
retrievable ​Boolean 属性是否可以检索
supported ​List 支持的属性

supported列表结构

参数 类型 描述
name ​String 属性名

示例

请求示例

{
    "id": "1509086454180",
    "version": "1.0",
    "request": {
        "apiVer": "1.0.0"
    },
    "params": {
        "accessToken" : "0bc19fa515354264450105920d45d2",
       "oauthOrigin" : "OPEN_ACCOUNT"
    }
}

正常返回示例

{
    "code": 200,
    "data": [{
        "capabilities": [{
            "type": "AlexaInterface",
            "version": "3",
            "interface": "Alexa.PowerController",
            "properties": {
                "supported": [{
                    "name": "powerState"
                }],
                "retrievable": true
            }
        }, {
            "type": "AlexaInterface",
            "version": "3",
            "interface": "Alexa.EndpointHealth",
            "properties": {
                "supported": [{
                    "name": "connectivity"
                }],
                "retrievable": true
            }
        }, {
            "type": "AlexaInterface",
            "version": "3",
            "interface": "Alexa.ColorTemperatureController",
            "properties": {
                "supported": [{
                    "name": "colorTemperatureInKelvin"
                }],
                "retrievable": true
            }
        }, {
            "type": "AlexaInterface",
            "version": "3",
            "interface": "Alexa.ColorController",
            "properties": {
                "supported": [{
                    "name": "color"
                }],
                "retrievable": true
            }
        }, {
            "type": "AlexaInterface",
            "version": "3",
            "interface": "Alexa.BrightnessController",
            "properties": {
                "supported": [{
                    "name": "brightness"
                }],
                "retrievable": true
            }
        }],
        "description": "BelonLight",
        "displayCategories": ["LIGHT"],
        "endpointId": "xtM6ZXgZeUUZjGCT71gQ001093a710",
        "friendlyName": "Reading light ",
        "manufacturerName": "Smart Home"
    }],
    "message": "success"
}

错误码

错误码 错误信息 来源 描述
200 success 系统 成功
400 request error. 系统 请求错误
401 request auth error. 系统 请求认证错误
403 request forbidden. 系统 请求被禁止
404 service not found. 系统 服务未找到
429 too many requests. 系统 太多请求
460 request parameter error. 系统 请求参数错误
500 service error. 系统 服务端错误
503 service not available. 系统 服务不可用

查询设备状态

定义描述

path 版本 描述 是否需要用户身份的鉴权
/device/status/querybyecho 1.0.0 查询设备状态

请求参数

参数 类型 必填 描述
accessToken String Oauth2.0 accessToken
oauthOrigin String oauth来源,目前支持OPEN_ACCOUNT
endpointId String 设备iotId

返回参数

参数 类型 必有 描述
statusList List 设备属性列表信息

statusList列表结构

参数 类型 描述
name ​List 属性名
namespace ​String 属性空间
timeOfSample ​List 时间戳
value ​Object ​属性值,若普通属性则为基本类型的值,符合属性则为Map

示例

请求示例

{
    "id": "1509086454180",
    "version": "1.0",
    "request": {
        "apiVer": "1.0.0"
    },
    "params": {
        "accessToken": "0bc19fa515354264450105920d45d2",
        "oauthOrigin": "OPEN_ACCOUNT",
        "endpointId": "xtM6ZXgZeUUZjGCT71gQ001093a710"
    }
}

正常返回示例

{
    "code": 200,
    "data": [{
        "name": "powerState",
        "namespace": "Alexa.PowerController",
        "timeOfSample": "2018-08-27T08:32:13.712Z",
        "uncertaintyInMilliseconds": 0,
        "value": "ON"
    }, {
        "name": "connectivity",
        "namespace": "Alexa.EndpointHealth",
        "timeOfSample": "2018-08-27T08:32:13.712Z",
        "uncertaintyInMilliseconds": 0,
        "value": "OK"
    }, {
        "name": "colorTemperatureInKelvin",
        "namespace": "Alexa.ColorTemperatureController",
        "timeOfSample": "2018-08-27T08:32:13.712Z",
        "uncertaintyInMilliseconds": 0,
        "value": 2000
    }, {
        "name": "color",
        "namespace": "Alexa.ColorController",
        "timeOfSample": "2018-08-27T08:32:13.712Z",
        "uncertaintyInMilliseconds": 0,
        "value": {
            "saturation": 0.5,
            "brightness": 0.5,
            "hue": 50
        }
    }, {
        "name": "brightness",
        "namespace": "Alexa.BrightnessController",
        "timeOfSample": "2018-08-27T08:32:13.712Z",
        "uncertaintyInMilliseconds": 0,
        "value": 73
    }],
    "message": "success"
}

错误码

错误码 错误信息 来源 描述
200 success 系统 成功
400 request error. 系统 请求错误
401 request auth error. 系统 请求认证错误
403 request forbidden. 系统 请求被禁止
404 service not found. 系统 服务未找到
429 too many requests. 系统 太多请求
460 request parameter error. 系统 请求参数错误
500 service error. 系统 服务端错误
503 service not available. 系统 服务不可用

控制设备

定义描述

path 版本 描述 是否需要用户身份的鉴权
/device/controlbyecho 1.0.0 控制设备

请求参数

参数 类型 必填 描述
accessToken String Oauth2.0 accessToken
oauthOrigin String oauth来源,目前支持OPEN_ACCOUNT
endpointId String 设备iotId
name String 能力名称
namespace String 能力空间
payload JSON 详细控制参数,key为属性名,value为属性值

返回参数

参数 类型 必有 描述

,

示例

请求示例

{
    "id": "1509086454180",
    "version": "1.0",
    "request": {
        "apiVer": "1.0.0"
    },

    "params": {
        "payload": {
            "brightness": 3
        },
        "oauthOrigin": "OPEN_ACCOUNT",
        "endpointId": "xtM6ZXgZeUUZjGCT71gQ001093a710",
        "namespace": "Alexa.BrightnessController",
        "name": "SetBrightness",
        "accessToken": "2726233df9ae46c376e1efb186065f3b"
    }
}

正常返回示例

{
    "code": 200,
    "message": "success"
}

错误码

错误码 错误信息 来源 描述
200 success 系统 成功
400 request error. 系统 请求错误
401 request auth error. 系统 请求认证错误
403 request forbidden. 系统 请求被禁止
404 service not found. 系统 服务未找到
429 too many requests. 系统 太多请求
460 request parameter error. 系统 请求参数错误
500 service error. 系统 服务端错误
503 service not available. 系统 服务不可用

results matching ""

    No results matching ""