nuraska90
nuraska90

Reputation: 27

botocore.exceptions.ParamValidationError: Parameter validation failed:

I use django-rest-sms-auth, which provides such providers as Twilio, Megafon, smsaero. But I've created another provider - Amazon SNS.

    def send_amazon_sms(self):
        client = boto3.client('sns', aws_access_key_id=self.conf.SMS_PROVIDER_LOGIN,
                              aws_secret_access_key=self.conf.SMS_PROVIDER_PASSWORD, region_name='eu-north-1')
        client.publish(PhoneNumber=str(self.to), Message=self.message)

    def send_sms(self):
        return self.send_amazon_sms()
//but it returns: 
**botocore.exceptions.ParamValidationError: Parameter validation failed:
Invalid type for parameter PhoneNumber, value: +996550102030, type: <class 'phonenumber_field.phonenumber.PhoneNumber'>, valid types: <class 'str'>**

Could you help me, why myphone_num is not correct? P.S. when I'm running this locally with my credentials and phone number as a separate python file, everything works fine

Upvotes: 0

Views: 1514

Answers (0)

Related Questions