Forked from negativo/gist:152716565e4091eb9039f55f9781badd
Created
September 27, 2016 17:26
-
-
Save kevinold/368387f8da42ce7d24179f3a14359051 to your computer and use it in GitHub Desktop.
send sms with aws provider in NODEJS
This file contains 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 AWS = require('aws-sdk'); | |
AWS.config.region = 'your aws region'; | |
AWS.config.update({ | |
accessKeyId: "your access id", | |
secretAccessKey: "your secret access key", | |
}); | |
var sns = new AWS.SNS(); | |
var params = { | |
Message: "your message" | |
MessageStructure: 'string', | |
PhoneNumber: 'phone_number_without_+', | |
Subject: 'your subject' | |
}; | |
sns.publish(params, function(err, data) { | |
if (err) console.log(err, err.stack); // an error occurred | |
else console.log(data); // successful response | |
}); |
Tavo962, you need to use at end of 11 line a ",". It's a JSON pattern :).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
On line 11 you have an error.
Greetings from Mexico City