LoginSignup
4
6

More than 5 years have passed since last update.

AmazonSNSをつかってSMSを送信する

Posted at

前提条件

  • python3.6.2
  • boto3
  • AmazonSNSFullAccess権限を付与する

スクリプト 

import boto3

sns = boto3.client("sns")

phone_number = '+81[電話番号]'

message = 'Test Message'

message_attributes = {
    'AWS.SNS.SMS.SenderID': {
        'DataType': 'String',
        'StringValue': 'northshore' # 通知者表示に使用される送信者ID
    }
}

sns.publish(
    PhoneNumber=phone_number, 
    Message=message,
    MessageAttributes=message_attributes)

4
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
6