:doc:`CognitoIdentityProvider <../../cognito-idp>` / Client / admin_get_device

****************
admin_get_device
****************



.. py:method:: CognitoIdentityProvider.Client.admin_get_device(**kwargs)

  

  Given the device key, returns details for a user's device. For more information, see `Working with devices <https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-device-tracking.html>`__.

   

  .. note::

    

    Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.

     

    **Learn more**

     

    
    * `Signing Amazon Web Services API Requests <https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-signing.html>`__
     
    * `Using the Amazon Cognito user pools API and user pool endpoints <https://docs.aws.amazon.com/cognito/latest/developerguide/user-pools-API-operations.html>`__
    

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminGetDevice>`_  


  **Request Syntax**
  ::

    response = client.admin_get_device(
        DeviceKey='string',
        UserPoolId='string',
        Username='string'
    )
    
  :type DeviceKey: string
  :param DeviceKey: **[REQUIRED]** 

    The key of the device that you want to delete.

    

  
  :type UserPoolId: string
  :param UserPoolId: **[REQUIRED]** 

    The ID of the user pool where the device owner is a user.

    

  
  :type Username: string
  :param Username: **[REQUIRED]** 

    The name of the user that you want to query or modify. The value of this parameter is typically your user's username, but it can be any of their alias attributes. If ``username`` isn't an alias attribute in your user pool, this value must be the ``sub`` of a local user or the username of a user from a third-party IdP.

    

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

    
    ::

      {
          'Device': {
              'DeviceKey': 'string',
              'DeviceAttributes': [
                  {
                      'Name': 'string',
                      'Value': 'string'
                  },
              ],
              'DeviceCreateDate': datetime(2015, 1, 1),
              'DeviceLastModifiedDate': datetime(2015, 1, 1),
              'DeviceLastAuthenticatedDate': datetime(2015, 1, 1)
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 

      Gets the device response, as an administrator.

      
      

      - **Device** *(dict) --* 

        Details of the requested device. Includes device information, last-accessed and created dates, and the device key.

        
        

        - **DeviceKey** *(string) --* 

          The device key, for example ``us-west-2_EXAMPLE-a1b2c3d4-5678-90ab-cdef-EXAMPLE22222``.

          
        

        - **DeviceAttributes** *(list) --* 

          Metadata about a user's device, like name and last-access source IP.

          
          

          - *(dict) --* 

            The name and value of a user attribute.

            
            

            - **Name** *(string) --* 

              The name of the attribute.

              
            

            - **Value** *(string) --* 

              The value of the attribute.

              
        
      
        

        - **DeviceCreateDate** *(datetime) --* 

          The date and time when the item was created. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a human-readable format like ISO 8601 or a Java ``Date`` object.

          
        

        - **DeviceLastModifiedDate** *(datetime) --* 

          The date and time when the item was modified. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a human-readable format like ISO 8601 or a Java ``Date`` object.

          
        

        - **DeviceLastAuthenticatedDate** *(datetime) --* 

          The date when the user last signed in with the device.

          
    
  
  **Exceptions**
  
  *   :py:class:`CognitoIdentityProvider.Client.exceptions.ResourceNotFoundException`

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

  
  *   :py:class:`CognitoIdentityProvider.Client.exceptions.InvalidUserPoolConfigurationException`

  
  *   :py:class:`CognitoIdentityProvider.Client.exceptions.TooManyRequestsException`

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

  
  *   :py:class:`CognitoIdentityProvider.Client.exceptions.NotAuthorizedException`

  