上报测点信息(HTTP)


上报测点数据使用的 topic 与 MQTT 协议一致,即/sys/{productKey}/{deviceKey}/thing/measurepoint/post


上报数据的完整 URL 格式为https://{HTTP_Broker_URL}/topic/sys/{productKey}/{deviceKey}/thing/measurepoint/post。其中:

  • {productKey} 为设备的 product key。
  • {deviceKey} 为设备的 device key。

上报数据请求示例

POST /topic/sys/{ProductKey}/{DeviceKey}/thing/measurepoint/post HTTP/1.1
Host: {HTTP_Broker_URL}
Query-Parameter: sessionId={SessionId}
Content-Type: application/json
body:
{
    "id":"123",
    "version":"1.0",
    "params":{
        "measurepoints":{
            "Power":{
                "value":1,
                "quality":9
            },
            "temp":1.02,
            "branchCurr":[
                "1.02",
                "2.02",
                "7.93"
            ]
        },
        "time":123456
    },
    "method":"thing.measurepoint.post"
}

返回结果示例

body:
{
    "id":"123",
    "code":200,
    "data":{}
}

以上示例中,各参数的说明以及结果返回码信息,参见基于 MQTT 的设备连接的 上报单个测点信息 的参数说明和结果返回码。