Skip to content

list_sms_sandbox_phone_numbers

list_sms_sandbox_phone_numbers(
    *,
    config_overrides: Optional[SNSClientConfig] = None,
    next_token: Optional[nextToken] = None,
    max_results: Optional[MaxItems] = None,
) -> ListSMSSandboxPhoneNumbersResult

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

When you start using Amazon SNS to send SMS messages, your Amazon Web Services 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 Amazon Web Services 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.

Parameters:

  • next_token (Optional[nextToken], default: None ) –

    Token that the previous ListSMSSandboxPhoneNumbersInput request returns.

  • max_results (Optional[MaxItems], default: None ) –

    The maximum number of phone numbers to return.

Raises:

Source code in docs_src/capo_sns/_services/sns.py
def list_sms_sandbox_phone_numbers(
    self,
    *,
    config_overrides: Optional[SNSClientConfig] = None,
    next_token: Optional["capo_sns.types.next_token.nextToken"] = None,
    max_results: Optional["capo_sns.types.max_items.MaxItems"] = None,
) -> "capo_sns.types.list_sms_sandbox_phone_numbers_result.ListSMSSandboxPhoneNumbersResult":
    """<p>Lists the calling Amazon Web Services account's current verified and pending destination phone numbers in the SMS sandbox.</p> <p>When you start using Amazon SNS to send SMS messages, your Amazon Web Services account is in the <i>SMS sandbox</i>. The SMS sandbox provides a safe environment for you to try Amazon SNS features without risking your reputation as an SMS sender. While your Amazon Web Services 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 <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html">SMS sandbox</a> in the <i>Amazon SNS Developer Guide</i>.</p>

    Args:
        next_token: <p>Token that the previous <code>ListSMSSandboxPhoneNumbersInput</code> request returns.</p>
        max_results: <p>The maximum number of phone numbers to return.</p>

    Raises:
        capo_sns.errors.authorization_error_exception.AuthorizationErrorException: <p>Indicates that the user has been denied access to the requested resource.</p>
        capo_sns.errors.internal_error_exception.InternalErrorException: <p>Indicates an internal service error.</p>
        capo_sns.errors.invalid_parameter_exception.InvalidParameterException: <p>Indicates that a request parameter does not comply with the associated constraints.</p>
        capo_sns.errors.resource_not_found_exception.ResourceNotFoundException: <p>Can’t perform the action on the specified resource. Make sure that the resource exists.</p>
        capo_sns.errors.throttled_exception.ThrottledException: <p>Indicates that the rate at which requests have been submitted for this action exceeds the limit for your Amazon Web Services account.</p>
        capo_sns.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sns.types.list_sms_sandbox_phone_numbers_input.ListSMSSandboxPhoneNumbersInput]",
    ) -> OperationResponse[
        "capo_sns.types.list_sms_sandbox_phone_numbers_result.ListSMSSandboxPhoneNumbersResult"
    ]:
        import capo_sns._operations.amazon_simple_notification_service.list_sms_sandbox_phone_numbers

        output, http_response = (
            capo_sns._operations.amazon_simple_notification_service.list_sms_sandbox_phone_numbers.list_sms_sandbox_phone_numbers(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_sns.types.list_sms_sandbox_phone_numbers_result.ListSMSSandboxPhoneNumbersResult",
    ) -> dict[str, Any]:
        import capo_sns.types.list_sms_sandbox_phone_numbers_result

        return (
            capo_sns.types.list_sms_sandbox_phone_numbers_result.redact_sensitive(
                output
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "ListSMSSandboxPhoneNumbers", redact_output=_redact_output
        ),
    )
    input_: capo_sns.types.list_sms_sandbox_phone_numbers_input.ListSMSSandboxPhoneNumbersInput = {}
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output