When I invoke my handler on backendless the output is correct. I copied the URL and placed it into my skill endpoint with the correct SSL setting. I when I test my skill on the alexa simulator the JSON response is a empty body. My backendless code is below since the wording would be too small to read on the picture:
var result, shadowState, seatState, intent;
intent = (await require(‘codeless-function-08b381a55e3bef4967bb07e4daaeba67’)(req));
console.log(intent)
if (intent == ‘Restroom’) {
seatState = (await require(‘codeless-function-09de7182118b296990273c43144ca926’)(req, intent, ‘toilet’));
}
console.log(seatState)
if (seatState == ‘seat’) {
shadowState = ‘{ “desired”: { “toilet”: “seat” } }’;
result = (JSON.stringify(‘The seat has been raised’));
} else {
shadowState = ‘{ “desired”: { “toilet”: “lid” } }’;
result = (JSON.stringify(‘The lid has been raised’));
}
await Backendless.Request[‘post’]((function(url){ if( !url ) { throw new Error(‘Url must be specified.’)} if( !url.startsWith(‘http://’) && !url.startsWith(‘https://’)) { return ‘https://’ + url } return url})(‘https://a3m5rn8w1ubaq0.iot.us-east-1.amazonaws.com/things/tCont/shadow’)).send(shadowState)
return (await require(‘codeless-function-6bc9ab143284f6b32546fcc89d948a27’)(result, false))