简体   繁体   English

在沙箱外使用AWS sns发送短信,还需要先验证新电话号码吗?

[英]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.我一直在寻找有关 SMS 的 AWS SNS 服务的信息。 I would like to make sure the question before I request AWS account being moved out of the SMS sandbox.在我请求将 AWS 账户移出 SMS 沙箱之前,我想确定这个问题。

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 .我正在尝试在 Heroku 上运行的产品上使用此服务,这意味着我必须使用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?问题来了:如果AWS账户退出短信沙箱并尝试向新的手机号码发送短信,是否还需要先验证手机号码才能收到短信?

I read those two document, but cannot ensure the services.我看了那两个文件,但不能保证服务。 Really appreciate any answers to help me figure out.非常感谢任何帮助我弄清楚的答案。

You do not need to verify phone numbers you wish to send SMS messages to once you have exited the SMS sandbox.退出 SMS 沙箱后,您无需验证要向其发送 SMS 消息的电话号码。 This is strictly a requirement for accounts in the SMS sandbox.这是 SMS 沙箱中帐户的严格要求。

You can test it in CLI and then in you app您可以在 CLI 中对其进行测试,然后在您的应用程序中进行测试

  1. get the number of your client in app在应用程序中获取您的客户编号

  2. put the value in this sintaxe:将值放入此 sintaxe 中:

    aws sns create-sms-sandbox-phone-number --phone-number aws sns 创建-短信-沙盒-电话号码--电话号码

  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 aws sns verify-sms-sandbox-phone-number --phone-number --one-time-password

  4. send it发送

    aws sns publish --message "Hello friend, you are subscribed!" aws sns publish --message "您好朋友,您已订阅!" --phone-number - 电话号码

IN CLI:在 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'])

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM