Skip to content

Instantly share code, notes, and snippets.

@marcuswestin
Created May 17, 2012 23:04
Show Gist options
  • Save marcuswestin/2722174 to your computer and use it in GitHub Desktop.
Save marcuswestin/2722174 to your computer and use it in GitHub Desktop.
Useful node snippet I had lying around from when evaluating twilio
var request = require('request')
var accountSid = 'ABC'
var authToken = 'XYZ'
var twilioSandbox = 'QWE'
var yourPhone = 'ASD'
var text = 'Test'
var url = 'https://'+accountSid+':'+authToken+'@api.twilio.com/2010-04-01/Accounts/'+accountSid+'/SMS/Messages.json'
var params = { From: twilioSandbox, To: yourPhone, Body: text }
request.post({ url:url, form:params }, function(err, res) {
console.log("HERE", err, res)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment