Publish

<< Click to Display Table of Contents >>

Navigation:  HTTPS REST API > POST API >

Publish

Previous pageReturn to chapter overviewNext page

Should be requested periodically to get tags values that have changed.

 

REQUEST:

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

 

BODY: You can use Query format: clientid={clientid}&token={token}&publishid={publishid}

Or JSON format: {

                 "clientid": {clientid},

                 "token": {token},

                 "publishid":{publishid}

         }

Where:

{clientid} - ID of your client

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

{publishid} - Confirmation of the previous publish response.

 

RESPONSES:

 

200                        Success. Get all tags values that have changed.

BODY JSON format:                {

                                 "publishid": {publishid},

                                 "subscribetags":{

                                 {tagname}: {tagvalue},

                                 {tagname}: {tagvalue},

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

                                 }

                         }

Where:

{publishid} - ID of the publish response. You have to confirm it in the next request.

{tagname} - Name of the tag.

{tagvalue} - Value of the tag in String format.

 

400                        Not success. Could not get tag's values.

 

EXAMPLE:

REQUEST:

Query format: clientid=0&token=fsgeEG&publishid=11

 

RESPONSE:

200

                         

JSON format:

                         {

                                 "publishid": 12,

                                 "subscribetags":

                                 {

                                         "Temperature": "24.5",

                                         "Humidity": "21.5",

                                         "Pressure": "67"

                                 }

                         }