IoT
This sections allows IoT management.
GET /iot/read
This method returns the values of the item.
Request parameters:
- company [mandatory]: the company name or id.
- session [mandatory]: the Id of the active session.
- id [mandatory]: the id of the item.
Response:
- status: returns "0" on success, and an error code in any other case.
- data: returns the value of the item.
- message: "success" or a descriptive information of the error in any other case.
Example of request:
{"type":"get", "url":"iot/read", "data":"company=demo01&session=LebEWTNf8GEhxfQeeGbBmVUlxmUIDLVdEoeVYrnWNzkdRXKxmgCNc92wnSjA&id=1953480"} |
Example of response:
{ "status": 0, "data": { "Val": "987", "ValSent": "986", "Upd": "20171017011517", "UpdSent": "20171017011516" }, "message": "Success" } |
GET /iot/log
This method returns the log of the values of the items.
Request parameters:
- company [mandatory]: the company name or id.
- session [mandatory]: the Id of the active session.
- datefrom [mandatory]: the start of the desired log.
- dateto [mandatory]: the end of the desired log.
Response:
- status: returns "0" on success, and an error code in any other case.
- data: returns the value of the item.
- message: "success" or a descriptive information of the error in any other case.
Example of request:
{"type":"get", "url":"iot/read", "data":"company=demo01&session=LebEWTNf8GEhxfQeeGbBmVUlxmUIDLVdEoeVYrnWNzkdRXKxmgCNc92wnSjA&datefrom=20170107171627&dateto=20190107171627"} |
Example of response:
{ "status": "0", "data": [{ datetime: "20190107171627", id: "1953480", id_signal: "343", mls: "258", val: "14500" }, { datetime: "20190107171627", id: "1953481", id_signal: "345", mls: "258", val: "26680" }], "message": "Success" } |