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

****************************
list_phone_numbers_opted_out
****************************



.. py:method:: SNS.Client.list_phone_numbers_opted_out(**kwargs)

  

  Returns a list of phone numbers that are opted out, meaning you cannot send SMS messages to them.

   

  The results for ``ListPhoneNumbersOptedOut`` are paginated, and each page returns up to 100 phone numbers. If additional phone numbers are available after the first page of results, then a ``NextToken`` string will be returned. To receive the next page, you call ``ListPhoneNumbersOptedOut`` again using the ``NextToken`` string received from the previous call. When there are no more records to return, ``NextToken`` will be null.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ListPhoneNumbersOptedOut>`_  


  **Request Syntax**
  ::

    response = client.list_phone_numbers_opted_out(
        nextToken='string'
    )
    
  :type nextToken: string
  :param nextToken: 

    A ``NextToken`` string is used when you call the ``ListPhoneNumbersOptedOut`` action to retrieve additional records that are available after the first page of results.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'phoneNumbers': [
              'string',
          ],
          'nextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 

      The response from the ``ListPhoneNumbersOptedOut`` action.

      
      

      - **phoneNumbers** *(list) --* 

        A list of phone numbers that are opted out of receiving SMS messages. The list is paginated, and each page can contain up to 100 phone numbers.

        
        

        - *(string) --* 
    
      

      - **nextToken** *(string) --* 

        A ``NextToken`` string is returned when you call the ``ListPhoneNumbersOptedOut`` action if additional records are available after the first page of results.

        
  
  **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`

  