Closed SCrid2000 closed 8 years ago
Yeah it will work with a different api. I'm not familiar with join but I see what happened. You have to specify to use http or https. I had it setup for http so it had an error trying to call that https address with the http protocol.
When I made this I didn't understand what this second line of code was doing: function httpreq(options, responseCallback) { var transport = options.useHttps ? https : http; var req = transport.request(options, function(httpResponse) {
So I changed it to http : http instead. In the options.js file there is a variable called useHttps that you can set to true or false. That line above says if true use the first one (https) and if false use the second one (http).
So there are many different ways to do it but just change that back to https : http down around the bottom of the index.js file and zip the 3 files back together and reupload to aws. Unless you changed it the options.js file already had useHttps = true so it will work once you change that. That assumes you aren't mixing any other urls that use http.
You can also just use this one line in your intent block of code to call a url: http.get('url_here'); or https.get('url_here');
The benefit of the function used in the skill is that it will send back an error response if it was unable to call the address. But I wasn't even taking advantage of that when I made this skill because I didn't understand that at the time.
Let me know if that didn't make sense or you need more help.
Thanks, that did it. Don't know why I didn't catch that. Had to change it to
var transport = options.useHttps ? http : https;
so https was second, not first.
Thanks!
Will this work with Join? I tried using the Join api rather than the autoremote one, but the echo speaks an error message after asking me to speak my message or say text and the contact name/message:
"There was a problem with the requested skills response"
The app gives the error message "The target Lambda application returned a failure response." Lambda gives the following error in the logs:
So maybe the problem is the join requires https and autoremote uses http?
The join api I replaced the autoremote one with is https://joinjoaomgcd.appspot.com/_ah/api/messaging/v1/sendPush?deviceId=' + options.ARkey + '&text=echo=:=' + intent.slots.Message.value