Javascript help

Post Reply
apietrocini
Member
Posts: 32
Joined: Fri Mar 24, 2017 7:06 pm
Location: Cleveland, OH

Javascript help

Post 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));
cstevens
Member
Posts: 103
Joined: Tue Feb 12, 2013 8:42 pm

Re: Javascript help

Post 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
Post Reply