Help with POST request with Venstar API

SOLVED!!

After some digging on github along with some other forums, I found an API guide (attached). Mode, fan, heattemp, cooltemp must always be posted together. Additionally pin if passcode is set. Command is submitted via an HTTP POST and is URL encoded instead of JSON.

Here’s the function for Control

var mode=flow.get('TmodeUpstairs');
var fan=flow.get('FmodeUpstairs');
var heat=flow.get('THeatUpstairs');
var cool=flow.get('TCoolUpstairs');

msg.headers={ 
    'Content-Type': 'application/x-www-form-urlencoded'
};
//msg.payload = {};
msg.payload={ 
'mode':mode,
'fan':fan,
'heattemp':heat,
'cooltemp':cool
};
return msg;

Here’s the API Guide.
vennstar-api.pdf (76.2 KB)

Here's an integration guide along with the flow.