Devices record data list
Get historical data by querying POST to /api/record with
a Ventra API
account using username and password which is in uppercase and SHA-256. When
call the POST method to /api/record, the system will return bites of data. With
Content-Type:
application/json; charset=utf-8
Parameters
| Name of Parameter | Type | Description |
|---|---|---|
| username | string | Required username |
| password | string | Required SHA-256 of your password
which is uppercase |
| deviceid | string | Required deviceid of device |
| date | string | Required UTC time of day start time,
UNIX time format |
Example
Get historical data by querying POST to URL /api/record
with username and password
GMT now = 20190725 03:10 = 1564024200
You want to get the historical data started from 20190725 00:00 which means 10:10 ago.
The localtime 20190725 00:00 => UTC time = 1564024200 - (10hours and 10mins)
1564024200 - (10 * 60 *60 + 10 *60) = 1563987600
URL https://www.ventracloud.com/api/record
POST /api/record
Content-Type: application/json; charset=utf-8
{
"username":"APIdemo",
"password":"58F0DB19BE70BFD8E53E1CAC8C32514853E97D0A44DA9B68A72046B7730BD5A6",
"deviceid": "VG000032",
"date": 1563987600
}
Response
The response is a numeric string of historical data.
[ 1,1,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1, 1,1,2,1,1,2,1,1,1,1,1, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, . . . 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1 ]
return: minute data array[1440] in a day from date of POST queryraw: every minute in this hour0: no record1: normal record2: alert record3: GPS only record
