check_if_phone_number_is_opted_out

SNS.Client.check_if_phone_number_is_opted_out(**kwargs)

Accepts a phone number and indicates whether the phone holder has opted out of receiving SMS messages from your Amazon Web Services account. You cannot send SMS messages to a number that is opted out.

To resume sending messages, you can opt in the number by using the OptInPhoneNumber action.

See also: AWS API Documentation

Request Syntax

response = client.check_if_phone_number_is_opted_out(
    phoneNumber='string'
)
Parameters
phoneNumber (string) --

[REQUIRED]

The phone number for which you want to check the opt out status.

Return type
dict
Returns
Response Syntax
{
    'isOptedOut': True|False
}

Response Structure

  • (dict) --

    The response from the CheckIfPhoneNumberIsOptedOut action.

    • isOptedOut (boolean) --

      Indicates whether the phone number is opted out:

      • true – The phone number is opted out, meaning you cannot publish SMS messages to it.
      • false – The phone number is opted in, meaning you can publish SMS messages to it.

Exceptions

  • SNS.Client.exceptions.ThrottledException
  • SNS.Client.exceptions.InternalErrorException
  • SNS.Client.exceptions.AuthorizationErrorException
  • SNS.Client.exceptions.InvalidParameterException