云服务器内容精选

  • 请求示例 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" } ] }
  • 错误码 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
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 request_id String 设备属性查询ID,用于唯一标识一条属性查询,在下发查询属性时由 物联网平台 分配获得。 response Object 设备上报的属性执行结果。Json格式,具体格式需要应用和设备约定。 error_code String 属性查询异常错误码。 error_msg String 属性查询异常错误信息。
  • 请求参数 表3 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 否 String 参数说明:用户Token。通过调用 IAM 服务 获取IAM用户Token接口获取,接口返回的响应消息头中“X-Subject-Token”就是需要获取的用户Token。简要的获取方法样例请参见 Token认证。 Instance-Id 否 String 参数说明:实例ID。物理多租下各实例的唯一标识,建议携带该参数,在使用专业版时必须携带该参数。您可以在IoTDA管理控制台界面,选择左侧导航栏“总览”页签查看当前实例的ID,具体获取方式请参考查看实例详情 。
  • URI GET /v5/iot/{project_id}/devices/{device_id}/properties 表1 路径参数 参数 是否必选 参数类型 描述 device_id 是 String 参数说明:下发属性的设备ID,用于唯一标识一个设备,在注册设备时由物联网平台分配获得。 取值范围:长度不超过128,只允许字母、数字、下划线(_)、连接符(-)的组合。 project_id 是 String 参数说明:项目ID。获取方法请参见 获取项目ID 。 表2 Query参数 参数 是否必选 参数类型 描述 service_id 是 String 参数说明:设备的服务ID,在设备关联的产品模型中定义。
  • 响应示例 状态码: 200 OK { "request_id" : "b1224afb-e9f0-4916-8220-b6bab568e888", "response" : { "services" : { "serviceId" : "Temperature", "properties" : { "PhV_phsA" : "1", "PhV_phsB" : "2" }, "eventTime" : "20190606T121212Z" } } }
  • 错误码 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.021103 The request batch properties number has reached the upper limit, limit %s. 请求中子设备数量达到上限 IOTDA.021105 The content reported in a single request cannot exceed 1 MB. 单次请求上报的内容不能超过1MB
  • 请求示例 POST https://{endpoint}/v5/devices/{device_id}/sys/gateway/sub-devices/properties/report Content-Type: application/json access_token: ****** { "devices" : [ { "device_id" : "deviceId_0001", "services" : [ { "service_id" : "serviceId", "properties" : { "Height" : 124, "Speed" : 23.24 }, "event_time" : "2021-08-13T10:10:10.555Z" } ] }, { "device_id" : "deviceId_0002", "services" : [ { "service_id" : "serviceId", "properties" : { "Height" : 124, "Speed" : 23.24 }, "event_time" : "2021-08-13T10:10:10.555Z" } ] } ] }
  • 请求示例 POST https://{endpoint}/v5/devices/{device_id}/sys/properties/reportContent-Type: application/jsonaccess_token: d144a524-1997-4b99-94bf-f27128da8a34{ "services" : [ { "service_id" : "serviceId", "properties" : { "Height" : 124, "Speed" : 23.24 }, "event_time" : "2021-08-13T10:10:10.555Z" } ]}
  • 错误码 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