Key Value
API /open/res/query
description query all resources that are available for the device
header {" Appid ": "xxx", " Appkey ": "xxx", "Openid": "xxx", " Access-Token ": "xxx" }
payload {"openId": "xxx", " did ": "xxx"}
response {"code": 0 (errorcode), "result": {"did": "xxx", "attr": [{"attr1": "xxx", "name": "xxx", "minValue" xxx "," maxValue ":" xxx "," enum ": [xx, xx, xx]}]}}
Key Value
API /open/res/query/option
description query the current value of the specified resource
header {" Appid ": "xxx", " Appkey ": "xxx", "Openid": "xxx", " Access-Token ": "xxx" }
payload {"openId": "xxx", " did ": "xxx", " option ": ["attr1", "attr2", ...]}
response {"code": 0 (errorcode), "result": {"did": "xxx", "data": {"attr1": "xxx", "attr2", ...}}}
Key Value
API /open/res/query/option/extended
description query the current value of some resources (easy to expand)
header {" Appid ": "xxx", " Appkey ": "xxx", "Openid": "xxx", " Access-Token ": "xxx" }
payload { "openId": "xxx", " did ": "xxx", " option ": ["attr1", "attr2", ...] }
response {"code": 0 (errorcode), "result": [{"did": "xxx", "attr": "xxx", "value": "xxx", "time": xxx}, {"did ":" xxx "," attr ":" xxx "," value ":" xxx "," time ": xxx}, ..]}
Key Value
API /open/res/query/multi/option/extended
description query multiple device current resources (easy to expand version)
header {" Appid ": "xxx", " Appkey ": "xxx", "Openid": "xxx", " Access-Token ": "xxx" }
payload {"openId": "xxx", "data": [{"did": "xxx", "option": ["attr1", "attr2", ...]}, {"did": "xxx" , "option": ["attr1", "attr2", ...]}, ..]}
response {"code": 0 (errorcode), "result": [{"did": "xxx", "attr": "xxx", "value": "xxx", "time": xxx}, {"did ":" xxx "," attr ":" xxx "," value ":" xxx "," time ": xxx}, ..]}
Key Value
API /open/res/query/user
description query the current value of the resource for all devices under the user
header {" Appid ": "xxx", " Appkey ": "xxx", "Openid": "xxx", " Access-Token ": "xxx" }
payload {"openId": "xxx"}
response {"code": 0 (errorcode), "result": [{"did": "xxx", "attr": "xxx", "value": "xxx", "time": xxx}, {"did ":" xxx "," attr ":" xxx "," value ":" xxx "," time ": xxx}, ..]}
Key Value
API /open/res/query/history/option
description query the history data of device
header {"Appid": "xxx", "Appkey": "xxx", "Openid": "xxx", "Access-Token": "xxx" }
payload {"openId": "xxx", "did": "xxx", "startDate": "2016-02-10", "endDate": "2016-03-10", "option": ["attr1" "attr2", ...], "startCount": xx, "endCount": xx}
response {"code": errorcode, "result": {"did": "11111", "data": [{"attr1": "value", "time": xxxxx}, {"attr1": "value "," time ": xxxx}, {" attr2 ":" value "," time ": xxxxx}, {}, ...}}}

Parameter description as follows:

  • openId: user id
  • did: device id
  • attr: resource of the device (see resource definition document for details)
  • startDate: the start date of the resource history
  • endDate: The end date of the resource history
  • startCount: The number of start of the query result paging
  • endCount: The number of cutouts of the query results page
  • time: timestamp (in seconds)

results matching ""

    No results matching ""