History DB read

<< Click to Display Table of Contents >>

Navigation:  HTTPS REST API > POST API >

History DB read

Previous pageReturn to chapter overviewNext page

REQUEST:

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

 

BODY: You can use Query format:

token={token}&historydbname={historydbname}&tagname={tagname}&begin={begin}&end={end}&numberofrows={numberofrows}

Or JSON format:

{

 "token": {token},

 "historydbname" {historydbname},

 "tagname":{tagname},

 "begin": {begin},

 "end": {end},

 "numberofrows":{numberofrows},

}

Where:

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

{historydbname} - Name of the history database

{tagname} - Name of the tag you want to read history information.

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

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

{numberofrow} - number of rows to be read from history database.

 

RESPONSES:

200 Success. Get tag's history information.

BODY JSON format:

{

 {datetime}:{historyvalue},

 {datetime}:{historyvalue}

}

Where:

{datetime} - Date and time 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&tagname=Temperature&begin=605359353893&end=6063442552522&numberofrows=1000

 

RESPONSE: 200

JSON format:

{

 "605359353893":"23.5",

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

 "6063442552522":"34.6"

}