Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save kevinold/368387f8da42ce7d24179f3a14359051 to your computer and use it in GitHub Desktop.
Save kevinold/368387f8da42ce7d24179f3a14359051 to your computer and use it in GitHub Desktop.
send sms with aws provider in NODEJS
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
Copy link

tavo962 commented May 1, 2018

Hello,

On line 11 you have an error.

Greetings from Mexico City

@jonascasarin
Copy link

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