Page 1 of 1

Javascript help

Posted: Fri Oct 11, 2019 6:04 pm
by apietrocini
Hello all!

What I'm trying to do is take something I'm doing through an execute command in switch and convert it to a switch script. I keep getting a parse error and I'm not sure why... Script works fine when I execute it in node, but fails in the switch scripter...? Any help would be great!

Code: Select all

const accountSid = 'AC?????????????'; // Your Account SID from www.twilio.com/console
const authToken = 'b4???????????????';   // Your Auth Token from www.twilio.com/console

const client = require('twilio')(accountSid, authToken);

client.messages.create({
    body: "Say something",
    to: '+12222222222', 
    from: '+13333333333', 
    
})
.then((message) => console.log(message.sid));

Re: Javascript help

Posted: Fri Oct 11, 2019 6:47 pm
by cstevens
I don't believe there's any support for external dependencies in Switch's scripting interface. You'll need to use the built-in HTTP Client:

https://www.enfocus.com/manuals/Develop ... class.html