:doc:`IoT <../../iot>` / Client / list_things

***********
list_things
***********



.. py:method:: IoT.Client.list_things(**kwargs)

  

  Lists your things. Use the **attributeName** and **attributeValue** parameters to filter your things. For example, calling ``ListThings`` with attributeName=Color and attributeValue=Red retrieves all things in the registry that contain an attribute **Color** with the value **Red**. For more information, see `List Things <https://docs.aws.amazon.com/iot/latest/developerguide/thing-registry.html#list-things>`__ from the *Amazon Web Services IoT Core Developer Guide*.

   

  Requires permission to access the `ListThings <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions>`__ action.

   

  .. note::

    

    You will not be charged for calling this API if an ``Access denied`` error is returned. You will also not be charged if no attributes or pagination token was provided in request and no pagination token and no results were returned.

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListThings>`_  


  **Request Syntax**
  ::

    response = client.list_things(
        nextToken='string',
        maxResults=123,
        attributeName='string',
        attributeValue='string',
        thingTypeName='string',
        usePrefixAttributeValue=True|False
    )
    
  :type nextToken: string
  :param nextToken: 

    To retrieve the next set of results, the ``nextToken`` value from a previous response; otherwise **null** to receive the first set of results.

    

  
  :type maxResults: integer
  :param maxResults: 

    The maximum number of results to return in this operation.

    

  
  :type attributeName: string
  :param attributeName: 

    The attribute name used to search for things.

    

  
  :type attributeValue: string
  :param attributeValue: 

    The attribute value used to search for things.

    

  
  :type thingTypeName: string
  :param thingTypeName: 

    The name of the thing type used to search for things.

    

  
  :type usePrefixAttributeValue: boolean
  :param usePrefixAttributeValue: 

    When ``true``, the action returns the thing resources with attribute values that start with the ``attributeValue`` provided.

     

    When ``false``, or not present, the action returns only the thing resources with attribute values that match the entire ``attributeValue`` provided.

    

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

    
    ::

      {
          'things': [
              {
                  'thingName': 'string',
                  'thingTypeName': 'string',
                  'thingArn': 'string',
                  'attributes': {
                      'string': 'string'
                  },
                  'version': 123
              },
          ],
          'nextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 

      The output from the ListThings operation.

      
      

      - **things** *(list) --* 

        The things.

        
        

        - *(dict) --* 

          The properties of the thing, including thing name, thing type name, and a list of thing attributes.

          
          

          - **thingName** *(string) --* 

            The name of the thing.

            
          

          - **thingTypeName** *(string) --* 

            The name of the thing type, if the thing has been associated with a type.

            
          

          - **thingArn** *(string) --* 

            The thing ARN.

            
          

          - **attributes** *(dict) --* 

            A list of thing attributes which are name-value pairs.

            
            

            - *(string) --* 
              

              - *(string) --* 
        
      
          

          - **version** *(integer) --* 

            The version of the thing record in the registry.

            
      
    
      

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

        The token to use to get the next set of results. Will not be returned if operation has returned all results.

        
  
  **Exceptions**
  
  *   :py:class:`IoT.Client.exceptions.InvalidRequestException`

  
  *   :py:class:`IoT.Client.exceptions.ThrottlingException`

  
  *   :py:class:`IoT.Client.exceptions.UnauthorizedException`

  
  *   :py:class:`IoT.Client.exceptions.ServiceUnavailableException`

  
  *   :py:class:`IoT.Client.exceptions.InternalFailureException`

  