本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
通知入門
本教學課程會逐步引導您建立通知組態並傳送您的第一個 OTP 訊息。您可以在大約 5 分鐘內完成本教學課程。
先決條件
AWS 帳戶。
AWS 最終使用者傳訊簡訊操作的 IAM 許可。如需詳細資訊,請參閱AWS 最終使用者傳訊簡訊的身分和存取管理。
下列 IAM 政策授予傳送訊息和瀏覽範本的許可:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "sms-voice:SendNotifyTextMessage", "sms-voice:SendNotifyVoiceMessage", "sms-voice:DescribeNotifyTemplates", "sms-voice:DescribeNotifyConfigurations", "sms-voice:ListNotifyCountries", "sms-voice:PutMessageFeedback" ], "Resource": "*" } ] }
下列政策會授予完整的通知管理許可:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "sms-voice:CreateNotifyConfiguration", "sms-voice:UpdateNotifyConfiguration", "sms-voice:DeleteNotifyConfiguration", "sms-voice:DescribeNotifyConfigurations", "sms-voice:DescribeNotifyTemplates", "sms-voice:ListNotifyCountries", "sms-voice:SendNotifyTextMessage", "sms-voice:SendNotifyVoiceMessage", "sms-voice:SetNotifyMessageSpendLimitOverride", "sms-voice:DeleteNotifyMessageSpendLimitOverride", "sms-voice:PutMessageFeedback" ], "Resource": "*" } ] }
若要限制特定通知組態的許可,請將組態 ARN 用於資源層級動作 (例如 SendNotifyTextMessage、SendNotifyVoiceMessage、DescribeNotifyConfigurations、CreateNotifyConfigurationUpdateNotifyConfiguration、 和 DeleteNotifyConfiguration)。不支援資源層級許可 (例如 DescribeNotifyTemplates、ListNotifyCountries、DeleteNotifyMessageSpendLimitOverride、 SetNotifyMessageSpendLimitOverride和 PutMessageFeedback) 的動作需要 "Resource": "*"。
步驟 1:建立通知組態
組態狀態:
- 待定
正在驗證組態。
- ACTIVE
準備好傳送訊息。
- REQUIRES_VERIFICATION
品牌名稱在啟用之前需要驗證。
- REJECTED
組態遭拒。檢查
RejectionReason詳細資訊。
步驟 2:瀏覽可用的範本
傳送之前,請檢查哪些範本適用於您的層和頻道:
aws pinpoint-sms-voice-v2 describe-notify-templates \ --filters '[{"Name":"channels","Values":["SMS"]},{"Name":"tier-access","Values":["BASIC"]}]'
步驟 3:傳送測試訊息
步驟 4:檢查可用的國家/地區
使用 ListNotifyCountries 查看適用於您的方案和頻道的國家/地區:
aws pinpoint-sms-voice-v2 list-notify-countries \ --channels SMS \ --tier BASIC