设备属性上报
接口说明
用于设备按产品模型中定义的格式将属性数据上报给平台。
URI
| 
         请求方法  | 
       
         POST  | 
      
|---|---|
| 
         URI  | 
       
         /v5/devices/{device_id}/sys/properties/report  | 
      
| 
         传输协议  | 
       
         HTTPS  | 
      
请求参数
| 
         名称  | 
       
         必选  | 
       
         类型  | 
       
         位置  | 
       
         说明  | 
      
|---|---|---|---|---|
| 
         access_token  | 
       
         是  | 
       
         String  | 
       
         Header  | 
       
         参数解释: 调用设备鉴权信息返回的access_token。 取值范围: 长度1-256。  | 
      
| 
         device_id  | 
       
         是  | 
       
         String  | 
       
         Path  | 
       
         参数解释: 设备ID,用于唯一标识一个设备。在注册设备时直接指定,或者由物联网平台分配获得。由物联网平台分配时,生成规则为"product_id" + "_" + "node_id"拼接而成。 取值范围: 长度不超过128,只允许字母、数字、下划线(_)、连接符(-)的组合。  | 
      
| 
         services  | 
       
         是  | 
       
         List<ServiceProperty>  | 
       
         Body  | 
       
         参数解释: 设备服务数据列表。  | 
      
请求示例
POST https://{endpoint}/v5/devices/{device_id}/sys/properties/report
Content-Type: application/json
access_token: ******
{
  "services" : [ {
    "service_id" : "serviceId",
    "properties" : {
      "Height" : 124,
      "Speed" : 23.24
    },
    "event_time" : "2021-08-13T10:10:10.555Z"
  } ]
}
  响应示例
Status Code: 200 上报正常
错误码
| 
         HTTP状态码  | 
       
         HTTP状态码描述  | 
       
         错误码  | 
       
         错误码描述  | 
       
         错误码中文描述  | 
      
|---|---|---|---|---|
| 
         400  | 
       
         Bad Request  | 
       
         IOTDA.000006  | 
       
         Invalid input data.  | 
       
         请求参数不合法  | 
      
| 
         IOTDA.021104  | 
       
         Subdevices in the request does not exist or does not belong to the gateway.  | 
       
         请求中有部分子设备不存在或不属于该网关.  | 
      ||
| 
         403  | 
       
         Forbidden  | 
       
         IOTDA.000004  | 
       
         Invalid access token.  | 
       
         非法token  | 
      
| 
         IOTDA.021101  | 
       
         Request reached the maximum rate limit.  | 
       
         请求已经达到限制速率  | 
      ||
| 
         IOTDA.021102  | 
       
         The request rate has reached the upper limit of the tenant, limit %s.  | 
       
         请求已经达到租户的限制速率  | 
      ||
| 
         IOTDA.021105  | 
       
         The content reported in a single request cannot exceed 1 MB.  | 
       
         单次请求上报的内容不能超过1MB  |