Created
May 17, 2012 23:04
-
-
Save marcuswestin/2722174 to your computer and use it in GitHub Desktop.
Useful node snippet I had lying around from when evaluating twilio
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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