amazon-sns

How to send SMS using Amazon SNS from a AWS lambda function

时间秒杀一切 提交于 2021-01-01 06:14:18
问题 Amazon SNS provides a facility to send SMS globally. I want to send SMS from a Lambda function were we provide the mobile number and text message and use SNS to deliver that message but I didn't find a helpful documentation or example code for NodeJS or java. Can any one suggest a solution? Code: var params = { Message: 'Hi this is message from AWS_SNS', /* required */ MessageAttributes: { someKey: { DataType: 'String' , StringValue: 'String' }, }, MessageStructure: 'String', PhoneNumber: '

ERROR sending a SMS with Amazon SNS and Python and boto3

落爺英雄遲暮 提交于 2020-12-13 03:49:36
问题 The documentation suggests to use the script below but I can't seem to figure out why im getting an error message. This what im using so far: sns = boto3.client('sns', region_name='eu-west-1') sns.publish( PhoneNumber='+5521981554856', Message='hi there', MessageAttributes={ 'AWS.SNS.SMS.SenderID': { 'DataType': 'String', 'StringValue': 'MySenderID' } } ) does anyone knows why im getting the error msg below? raise ParamValidationError(report=report.generate_report()) ParamValidationError: