Skip to content

发送下行物模型服务数据

接口地址:/v2/deviceshadow/r3/openapi/dm/sendServiceData

请求方式:POST

请求数据类型:application/json

响应数据类型:*/*

接口描述: data数据格式为:

json
[{"key1":"value"},{"key2":"value"}]

示例:

  • bool/int/float/double/enum/date/text
json
[{"key":[{"key1":"value1"},{"key2":"value2"},{"key3":"value3"}]}]
  • array (id为0)
json
[{"key":[{"key1":[{"0":"value1"},{"0":"value1"}]}]}]
  • struct
json
[{"key":[{"key1":[{"key2":"value2"},{"key3":"value3"}]}]}]
  • array,且 array 含有 struct (id为0)
json
[{"key":[{"key1":[{"0":[{"key2":"value2"}]},{"0":[{"key3":"value3"}]}]}]}]

请求示例:

javascript
{
  "cacheTime": 0,
  "data": "",
  "devices": [],
  "extendPara": {},
  "isCache": true,
  "isCover": true,
  "productKey": "",
  "qos": 0
}

请求参数:

参数名称参数说明请求类型是否必须数据类型schema
readDataDTOR3readDataDTOR3bodytrueOpenApiSendTslDataDTOOpenApiSendTslDataDTO
  cacheTime缓存时间,单位s。当isCache为true时生效,默认值600。falseinteger(int64)
  data发送下行数据的具体内容truestring
  devices设备列表truearraystring
  extendParafalseobject
  isCache是否启用缓存,不传默认为falsefalseboolean
  isCover是否覆盖前面发送的数据,不传默认为falsefalseboolean
  productKey产品productKeytruestring
  qosqos等级设置(不传默认为1)falseinteger(int32)
language语言:CN/EN(默认:CN)queryfalsestring

响应状态:

状态码说明schema
200OKActionResult
201Created
401Unauthorized
403Forbidden
404Not Found
50000service exception
50005param check error
50007The deviceID, productKey or deviceKey is empty.
61001PROTOCOL_NOT_SUPPORT
61002device offline
61005Unauthorized device.
61006device message upper limit
61007device message frequency is limited
70000Hub 服务不可用
70026The sub-device is not connected to the gateway device.
70051Failed data sending.
70083Product category and parameter type are unmatched.
70089You have limited permission to operate this project or product or device.
70090The number is out of range or step size.
70091The value is not a member of the enumeration.
70092The text is too long.
70093Incorrect time stamp character.
70094The TSL model is unable to analysis and identify data.
70095Failed to call cloudBridgeService.
70096Failed to issue command from DMP to AEP.
71008TSL data format verification error.
71027TSL model downlink data format is not JSON.
71028TSL model downlink data format verification error.
71029Illegal downlink data setting for TSL model.
71035Parameter verification error.
71036TSL model data verification error.
71038Failed communication. Read-only attributes can't send commands.
71039The length of message array has exceeded the defined size.
71047Downstream Tsl data format check error.
71048The fetch instruction cannot only contain write-only data.
80005OpenAPI does not support setting AEP products.
91001token not exists
91004token incorrect
91005doesn't have permission
91006user not exist ip white list reference.
91007please open API permission.

响应参数:

参数名称参数说明类型schema
code返回码object
data对象object
exp1string
msg提示信息object
pageNum当前页数object
pageSize每页数量object
pages总页数object
total总数object

响应示例:

javascript
{
    "code": {},
    "data": {},
    "exp1": "",
        "msg": {},
    "pageNum": {},
    "pageSize": {},
    "pages": {},
    "total": {}
}