:doc:`SNS <../../sns>` / Client / check_if_phone_number_is_opted_out

**********************************
check_if_phone_number_is_opted_out
**********************************



.. py:method:: 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 <https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CheckIfPhoneNumberIsOptedOut>`_  


  **Request Syntax**
  ::

    response = client.check_if_phone_number_is_opted_out(
        phoneNumber='string'
    )
    
  :type phoneNumber: string
  :param phoneNumber: **[REQUIRED]** 

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

    

  
  
  :rtype: 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**
  
  *   :py:class:`SNS.Client.exceptions.ThrottledException`

  
  *   :py:class:`SNS.Client.exceptions.InternalErrorException`

  
  *   :py:class:`SNS.Client.exceptions.AuthorizationErrorException`

  
  *   :py:class:`SNS.Client.exceptions.InvalidParameterException`

  