KaoChing-Ya
KaoChing-Ya

Reputation: 1

Sending sms using AWS sns outside sandbox, still need to verify the new phone number first?

I keep looking for the informaion on AWS SNS services of SMS. I would like to make sure the question before I request AWS account being moved out of the SMS sandbox.

I am trying to use this services on a product running on Heroku, which means I have to use the region on US East (N. Virginia) us-east-1. But the product users mainly live in Asia. I test it in sandbox mode, and it can receive the message.

Here comes the question: If AWS account exits SMS sandbox and try to send SMS to a new phone number, do I still need to verify the phone number first then it can receive the message?

I read those two document, but cannot ensure the services. Really appreciate any answers to help me figure out.

Upvotes: 0

Views: 1953

Answers (2)

You can test it in CLI and then in you app

  1. get the number of your client in app

  2. put the value in this sintaxe:

    aws sns create-sms-sandbox-phone-number --phone-number

  3. ask the customer for the code and put it in this syntax

    aws sns verify-sms-sandbox-phone-number --phone-number --one-time-password

  4. send it

    aws sns publish --message "Hello friend, you are subscribed!" --phone-number

IN CLI:

aws sns create-sms-sandbox-phone-number --phone-number <value>
aws sns verify-sms-sandbox-phone-number --phone-number <value> --one-time-password <value>
aws sns publish --message "Hello friend, you are subscribed!" --phone-number <value>

IN APP:

>>> import subprocess
>>> subprocess.run(['aws','sns', 'publish', '--message', '"Hello, world!"', '--phone-number', '+5511123456789'])

Upvotes: 0

bjrnt
bjrnt

Reputation: 2822

You do not need to verify phone numbers you wish to send SMS messages to once you have exited the SMS sandbox. This is strictly a requirement for accounts in the SMS sandbox.

Upvotes: 0

Related Questions