Amazon Simple Notification Service

2021/06/01 - Amazon Simple Notification Service - 6 new api methods

Changes  This release adds SMS sandbox in Amazon SNS and the ability to view all configured origination numbers. The SMS sandbox provides a safe environment for sending SMS messages, without risking your reputation as an SMS sender.

CreateSMSSandboxPhoneNumber (new) Link ¶

Adds a destination phone number to an AWS account in the SMS sandbox and sends a one-time password (OTP) to that phone number.

When you start using Amazon SNS to send SMS messages, your AWS account is in the SMS sandbox . The SMS sandbox provides a safe environment for you to try Amazon SNS features without risking your reputation as an SMS sender. While your account is in the SMS sandbox, you can use all of the features of Amazon SNS. However, you can send SMS messages only to verified destination phone numbers. For more information, including how to move out of the sandbox to send messages without restrictions, see SMS sandbox in the Amazon SNS Developer Guide .

See also: AWS API Documentation

Request Syntax

client.create_sms_sandbox_phone_number(
    PhoneNumber='string',
    LanguageCode='en-US'|'en-GB'|'es-419'|'es-ES'|'de-DE'|'fr-CA'|'fr-FR'|'it-IT'|'ja-JP'|'pt-BR'|'kr-KR'|'zh-CN'|'zh-TW'
)
type PhoneNumber

string

param PhoneNumber

[REQUIRED]

The destination phone number to verify. On verification, Amazon SNS adds this phone number to the list of verified phone numbers that you can send SMS messages to.

type LanguageCode

string

param LanguageCode

The language to use for sending the OTP. The default value is en-US .

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

DeleteSMSSandboxPhoneNumber (new) Link ¶

Deletes an AWS account's verified or pending phone number from the SMS sandbox.

When you start using Amazon SNS to send SMS messages, your AWS account is in the SMS sandbox . The SMS sandbox provides a safe environment for you to try Amazon SNS features without risking your reputation as an SMS sender. While your account is in the SMS sandbox, you can use all of the features of Amazon SNS. However, you can send SMS messages only to verified destination phone numbers. For more information, including how to move out of the sandbox to send messages without restrictions, see SMS sandbox in the Amazon SNS Developer Guide .

See also: AWS API Documentation

Request Syntax

client.delete_sms_sandbox_phone_number(
    PhoneNumber='string'
)
type PhoneNumber

string

param PhoneNumber

[REQUIRED]

The destination phone number to delete.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

ListSMSSandboxPhoneNumbers (new) Link ¶

Lists the calling AWS account's current verified and pending destination phone numbers in the SMS sandbox.

When you start using Amazon SNS to send SMS messages, your AWS account is in the SMS sandbox . The SMS sandbox provides a safe environment for you to try Amazon SNS features without risking your reputation as an SMS sender. While your account is in the SMS sandbox, you can use all of the features of Amazon SNS. However, you can send SMS messages only to verified destination phone numbers. For more information, including how to move out of the sandbox to send messages without restrictions, see SMS sandbox in the Amazon SNS Developer Guide .

See also: AWS API Documentation

Request Syntax

client.list_sms_sandbox_phone_numbers(
    NextToken='string',
    MaxResults=123
)
type NextToken

string

param NextToken

Token that the previous ListSMSSandboxPhoneNumbersInput request returns.

type MaxResults

integer

param MaxResults

The maximum number of phone numbers to return.

rtype

dict

returns

Response Syntax

{
    'PhoneNumbers': [
        {
            'PhoneNumber': 'string',
            'Status': 'Pending'|'Verified'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • PhoneNumbers (list) --

      A list of the calling account's pending and verified phone numbers.

      • (dict) --

        A verified or pending destination phone number in the SMS sandbox.

        When you start using Amazon SNS to send SMS messages, your AWS account is in the SMS sandbox . The SMS sandbox provides a safe environment for you to try Amazon SNS features without risking your reputation as an SMS sender. While your account is in the SMS sandbox, you can use all of the features of Amazon SNS. However, you can send SMS messages only to verified destination phone numbers. For more information, including how to move out of the sandbox to send messages without restrictions, see SMS sandbox in the Amazon SNS Developer Guide .

        • PhoneNumber (string) --

          The destination phone number.

        • Status (string) --

          The destination phone number's verification status.

    • NextToken (string) --

      A NextToken string is returned when you call the ListSMSSandboxPhoneNumbersInput operation if additional pages of records are available.

ListOriginationNumbers (new) Link ¶

Lists the calling AWS account's dedicated origination numbers and their metadata. For more information about origination numbers, see Origination numbers in the Amazon SNS Developer Guide .

See also: AWS API Documentation

Request Syntax

client.list_origination_numbers(
    NextToken='string',
    MaxResults=123
)
type NextToken

string

param NextToken

Token that the previous ListOriginationNumbers request returns.

type MaxResults

integer

param MaxResults

The maximum number of origination numbers to return.

rtype

dict

returns

Response Syntax

{
    'NextToken': 'string',
    'PhoneNumbers': [
        {
            'CreatedAt': datetime(2015, 1, 1),
            'PhoneNumber': 'string',
            'Status': 'string',
            'Iso2CountryCode': 'string',
            'RouteType': 'Transactional'|'Promotional'|'Premium',
            'NumberCapabilities': [
                'SMS'|'MMS'|'VOICE',
            ]
        },
    ]
}

Response Structure

  • (dict) --

    • NextToken (string) --

      A NextToken string is returned when you call the ListOriginationNumbers operation if additional pages of records are available.

    • PhoneNumbers (list) --

      A list of the calling account's verified and pending origination numbers.

      • (dict) --

        A list of phone numbers and their metadata.

        • CreatedAt (datetime) --

          The date and time when the phone number was created.

        • PhoneNumber (string) --

          The phone number.

        • Status (string) --

          The status of the phone number.

        • Iso2CountryCode (string) --

          The two-character code for the country or region, in ISO 3166-1 alpha-2 format.

        • RouteType (string) --

          The list of supported routes.

        • NumberCapabilities (list) --

          The capabilities of each phone number.

          • (string) -- Enum listing out all supported number capabilities.

GetSMSSandboxAccountStatus (new) Link ¶

Retrieves the SMS sandbox status for the calling AWS account in the target AWS Region.

When you start using Amazon SNS to send SMS messages, your AWS account is in the SMS sandbox . The SMS sandbox provides a safe environment for you to try Amazon SNS features without risking your reputation as an SMS sender. While your account is in the SMS sandbox, you can use all of the features of Amazon SNS. However, you can send SMS messages only to verified destination phone numbers. For more information, including how to move out of the sandbox to send messages without restrictions, see SMS sandbox in the Amazon SNS Developer Guide .

See also: AWS API Documentation

Request Syntax

client.get_sms_sandbox_account_status()
rtype

dict

returns

Response Syntax

{
    'IsInSandbox': True|False
}

Response Structure

  • (dict) --

    • IsInSandbox (boolean) --

      Indicates whether the calling account is in the SMS sandbox.

VerifySMSSandboxPhoneNumber (new) Link ¶

Verifies a destination phone number with a one-time password (OTP) for the calling AWS account.

When you start using Amazon SNS to send SMS messages, your AWS account is in the SMS sandbox . The SMS sandbox provides a safe environment for you to try Amazon SNS features without risking your reputation as an SMS sender. While your account is in the SMS sandbox, you can use all of the features of Amazon SNS. However, you can send SMS messages only to verified destination phone numbers. For more information, including how to move out of the sandbox to send messages without restrictions, see SMS sandbox in the Amazon SNS Developer Guide .

See also: AWS API Documentation

Request Syntax

client.verify_sms_sandbox_phone_number(
    PhoneNumber='string',
    OneTimePassword='string'
)
type PhoneNumber

string

param PhoneNumber

[REQUIRED]

The destination phone number to verify.

type OneTimePassword

string

param OneTimePassword

[REQUIRED]

The OTP sent to the destination number from the CreateSMSSandBoxPhoneNumber call.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

    The destination phone number's verification status.