

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# Notify の開始方法
<a name="notify-getting-started"></a>

このチュートリアルでは、Notify 設定を作成し、最初の OTP メッセージを送信する手順を説明します。このチュートリアルは約 5 分で完了できます。

## 前提条件
<a name="notify-getting-started-prereqs"></a>
+  AWS アカウント。
+  AWS エンドユーザーメッセージング SMS オペレーションの IAM アクセス許可。詳細については、「[AWS エンドユーザーメッセージング SMS の ID とアクセスの管理](security-iam.md)」を参照してください。

次の 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": "*"
        }
    ]
}
```

アクセス許可を特定の通知設定に制限するには、リソースレベルのアクション (`SendNotifyTextMessage`、、`SendNotifyVoiceMessage`、、`UpdateNotifyConfiguration`、 など) `DescribeNotifyConfigurations` `CreateNotifyConfiguration`の設定 ARN を使用します`DeleteNotifyConfiguration`。リソースレベルのアクセス許可 (`DescribeNotifyTemplates`、`ListNotifyCountries`、、`SetNotifyMessageSpendLimitOverride`、 など`PutMessageFeedback`) をサポートしないアクションには`DeleteNotifyMessageSpendLimitOverride`、 が必要です`"Resource": "*"`。

## ステップ 1: 通知設定を作成する
<a name="notify-getting-started-create"></a>

------
#### [ Console ]

1. [https://console.aws.amazon.com/sms-voice/](https://console.aws.amazon.com/sms-voice/) で AWS エンドユーザーメッセージング SMS コンソールを開きます。

1. ナビゲーションペインの**「通知**」で、**「通知設定**」を選択します。

1. Create **Notify 設定**を選択します。

1. **表示名**に、ブランド名を入力します (例: `AcmeCorp`)。

1. **ユースケース**では、**コード検証**が自動的に選択されます。

1. **チャネル**で、**SMS**、**VOICE**、またはその両方を選択します。

1. (オプション) **詳細設定**を展開して、国、デフォルトのテンプレート、関連付けられたプールを選択するか、削除保護を有効にします。

1. Create **Notify 設定**を選択します。

設定は、システムがアカウントを検証している間、**保留中**のステータスで作成されます。検証されると、ステータスは**アクティブ**に変わり、メッセージの送信を開始できます。

**注記**  
設定の作成には、自動アカウント検証とブランド名チェックが含まれます。ほとんどの設定は数秒以内にアクティブ化されます。ブランド名に検証が必要な場合、ステータスは**検証が必要です**。

------
#### [ AWS CLI ]

```
aws pinpoint-sms-voice-v2 create-notify-configuration \
    --display-name "AcmeCorp" \
    --use-case CODE_VERIFICATION \
    --enabled-channels SMS
```

------

設定ステータス:

保留中  
設定は検証中です。

アクティブ  
メッセージを送信する準備ができました。

REQUIRES\_VERIFICATION  
ブランド名には、アクティベーション前に検証が必要です。

拒否  
設定が拒否されました。詳細については、`RejectionReason`「」を参照してください。

## ステップ 2: 使用可能なテンプレートを参照する
<a name="notify-getting-started-templates"></a>

送信する前に、階層とチャネルで使用できるテンプレートを確認してください。

```
aws pinpoint-sms-voice-v2 describe-notify-templates \
    --filters '[{"Name":"channels","Values":["SMS"]},{"Name":"tier-access","Values":["BASIC"]}]'
```

## ステップ 3: テストメッセージを送信する
<a name="notify-getting-started-send"></a>

------
#### [ Console ]

1. 設定の通知リストで、設定を選択します。

1. **[テスト]** タブを選択します。

1. テンプレートテーブルからテンプレートを選択します。

1. **送信先の電話番号**には、E.164 形式で電話番号を入力します (例: `+12065550100`)。

1. テンプレート変数を入力します (たとえば、**コード**変数`123456`に を入力します）。

1. **[送信]** を選択します。

------
#### [ AWS CLI ]

```
aws pinpoint-sms-voice-v2 send-notify-text-message \
    --notify-configuration-id "{{nc-1234567890abcdef0}}" \
    --destination-phone-number "{{+12065550100}}" \
    --template-id "{{notify-code-verification-english-001}}" \
    --template-variables '{"code":"123456"}'
```

------
#### [ Python (boto3) ]

```
import boto3

client = boto3.client('pinpoint-sms-voice-v2')

response = client.send_notify_text_message(
    NotifyConfigurationId='nc-1234567890abcdef0',
    DestinationPhoneNumber='+12065550100',
    TemplateId='notify-code-verification-english-001',
    TemplateVariables={
        'code': '123456'
    }
)

print(f"Message ID: {response['MessageId']}")
print(f"Resolved body: {response['ResolvedMessageBody']}")
```

------

## ステップ 4: 利用可能な国を確認する
<a name="notify-getting-started-countries"></a>

を使用して`ListNotifyCountries`、階層とチャネルで利用可能な国を確認します。

```
aws pinpoint-sms-voice-v2 list-notify-countries \
    --channels SMS \
    --tier BASIC
```

## 次の手順
<a name="notify-getting-started-next"></a>
+ [通知設定の管理](notify-configurations.md) – すべての設定オプションについて説明します。
+ [Notify テンプレートの使用](notify-templates.md) – 使用可能なテンプレートを参照して理解します。
+ [階層の通知](notify-tiers.md) – 階層と Advanced にアップグレードする方法について説明します。
+ [支出制限を通知する](notify-spend-limits.md) – 通知の使用制限を管理します。