Skip to content

SNS  >  Operations  >  check_if_phone_number_is_opted_out

check_if_phone_number_is_opted_out

Operation

check_if_phone_number_is_opted_out async

check_if_phone_number_is_opted_out(input: CheckIfPhoneNumberIsOptedOutInput, plugins: list[Plugin] | None = None) -> CheckIfPhoneNumberIsOptedOutOutput

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.

Parameters:

Name Type Description Default
input CheckIfPhoneNumberIsOptedOutInput

An instance of CheckIfPhoneNumberIsOptedOutInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
CheckIfPhoneNumberIsOptedOutOutput

An instance of CheckIfPhoneNumberIsOptedOutOutput.

Input

CheckIfPhoneNumberIsOptedOutInput dataclass

The input for the CheckIfPhoneNumberIsOptedOut action.

Attributes

phone_number class-attribute instance-attribute
phone_number: str | None = field(repr=False, default=None)

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

Output

CheckIfPhoneNumberIsOptedOutOutput dataclass

The response from the CheckIfPhoneNumberIsOptedOut action.

Attributes

is_opted_out class-attribute instance-attribute
is_opted_out: bool = False

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.