How To Send SMS Using AWS SNS

import boto3


client = boto3.client(

            "sns",

            aws_access_key_id='',

            aws_secret_access_key='',

            region_name= ''

        )

mobile_number = "+91 9999988888"


Note: it will acept this following mobile number formates #+91 9999988888, +91-9999988888, +919999988888,+91-99999-88888, +9199999-88888, +9199999-88888, +91 9999988888

            

res = self.client.publish(PhoneNumber=mobile_no, Message=message)


mess_id = res['MessageId']

res_status = res['ResponseMetadata']

status = res_status['HTTPStatusCode']


Note:

To get aws access key & aws_secret_access_key, please follow this Article  - https://medium.com/codephilics/how-to-send-a-sms-using-amazon-simple-notification-service-sns-46208d82abcc


Comments

Popular posts from this blog

ERR: error parsing query: found influx, expected SELECT, DELETE, SHOW, CREATE, DROP, EXPLAIN, GRANT, REVOKE, ALTER, SET, KILL at line

How to get Full URL or get absolute url In Django

How To Convert Html File/URL/String Into Image Using Python