中国移动ONENET
[OneNet]
多协议连接-HTTP
添加数据点
- 请求方法:POST
- URL:https://api.heclouds.com/devices/{device_id}/datapoints
- 请求参数 JSON
{
"datastreams": [{
"id": "LED", #数据流名称
"datapoints": [{
"at": "2023-02-21T11:35:43", #上传时间
"value": "0" #上传的数值
} ]
}]
}
{
"datastreams": [{
"id": "LOG",
"datapoints": [{
"at": "2023-02-21T11:35:43",
"value": "M.Y.Dodo"
} ]
}]
}
获取数据点
- 请求方法:GET
- URL:https://api.heclouds.com/devices/{device_id}/datastreams
- 返回内容 JSON
{
"errno": 0,
"data": [
{
"unit": "state",
"unit_symbol": "",
"create_time": null,
"update_at": "2023-02-21 11:35:43",
"id": "LED",
"current_value": "0"
}
],
"error": "succ"
}
报错:
1.
注意 POST 和 GET 的url不要弄混