Create a notify code configuration
A notify code configuration is a reusable passcode policy and message-template set for one-time passcode verifications. It defines the code type, length, validity period, and maximum attempts, plus per-channel templates for the text, voice, and WhatsApp channels. Any policy field you leave blank uses the service default at send time.
- AWS Management Console
-
To create a notify code configuration using the console
-
Open the AWS End User Messaging console at https://console.aws.amazon.com/sms-voice/
. -
In the navigation pane, under Notify, choose Code configurations.
-
On the Code configurations page, choose Create code configuration.
-
Under Configuration details, for Name enter a display name (1–64 characters). The name does not need to be unique.
-
Under Passcode policy, set any of the following. Leave a field blank to use the service default at send time.
Code type — the character set for generated passcodes.
Code length — 4 to 8 characters (defaults to 6).
Validity period (minutes) — 1 to 60 minutes (defaults to 10).
Maximum attempts — 1 to 5 attempts (defaults to 3).
-
(Optional) Expand Advanced settings to add per-channel message templates for Text, Voice, and WhatsApp, a pre-approved notify template, and tags.
-
Choose Create code configuration.
-
- AWS CLI
-
To create a notify code configuration using the AWS CLI
-
At the command line, enter the following command:
$aws endusermessaging create-notify-code-configuration \ > --notify-code-configuration-nameMyVerificationPolicy\ > --code-configuration-parameters codeLength=6,validityPeriodMinutes=10,maxAttempts=3In the preceding command, make the following changes:
Replace
MyVerificationPolicywith a name for the configuration (1–64 characters).In
--code-configuration-parameters, set any ofcodeType,codeLength(4–8),validityPeriodMinutes(1–60), andmaxAttempts(1–5). Omit a value to use the service default at send time.
To add per-channel templates, use
--channel-parameters(text,voice,whatsApp,notify). To protect the configuration, add--deletion-protection-enabled. -
The response resembles the following:
{ "notifyCodeConfiguration": { "notifyCodeConfigurationId": "cc-3bnvvqhwq05xr3fkj", "notifyCodeConfigurationName": "MyVerificationPolicy", "codeConfigurationParameters": {"codeLength": 6, "validityPeriodMinutes": 10, "maxAttempts": 3}, "deletionProtectionEnabled": false } }
-