History DB table read

<< Click to Display Table of Contents >>

Navigation:  HTTPS REST API > POST API >

History DB table read

Previous pageReturn to chapter overviewNext page

REQUEST:

URI: https://cloud.teslascada.com/historydbread

 

BODY: You can use Query format: token={token}&historydbname={historydbname}&decimalpos={decimalpos}&begin={begin}&end={end}&orderby={orderby}&type={type}&timeformat={timeformat}

Or JSON format:

{

 "token": {token},

 "historydbname" {historydbname},

 "decimalpos":{decimalpos},

 "begin": {begin},

 "end": {end},

 "orderby":{orderby},

 "type":{type},

 "timeformat":{timeformat}

}

Where:

{token} - Your TeslaCloud token that you got after connecting

{historydbname} - Name of the history database

{decimalpos} - Decimal position for the values displayed in History table.

{begin} - Begin time period in milliseconds since 1970 year.

{end} - End time period in milliseconds since 1970 year.

{orderby} - Order by of the table's values.

{type} - Display date and time in the same column or not.

{timeformat} - Format of the date and time column encoded by Base64 without padding.

 

RESPONSES:

200 Success. Get history information for table.

BODY JSON format: Array of History values:

{

 "id":{id},

 "date":{date},

 "time":{time},

 "ingredients":{

 {name}:{historyvalue},

 ..........................................

 {name}:{historyvalue}

}

Where:

{id} - ID of the History table's row.

{date} - Date of the history values.

{time} - Time of the history values.

{name} - Name of the history value.

{historyvalue} - History value.

 

400 Not success. Could not get tag's history information.

 

EXAMPLE:

REQUEST:

Query format:

token=fdeEWd&historydbname=HistoryDB&decimalpos=1&begin=605359353893&end=6063442552522&orderby=1&type=1&timeformat=SEg6bW06c3MK

 

RESPONSE: 200

JSON format: Array of History values:

{

 "id":1,

 "date":"23/12/2022",

 "time":"18:44:44",

 "ingredients":{

         "Temperature":23.5,

         "Humidity":60

         }

}