:doc:`LocationService <../../location>` / Client / batch_get_device_position

*************************
batch_get_device_position
*************************



.. py:method:: LocationService.Client.batch_get_device_position(**kwargs)

  

  Lists the latest device positions for requested devices.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/location-2020-11-19/BatchGetDevicePosition>`_  


  **Request Syntax**
  ::

    response = client.batch_get_device_position(
        TrackerName='string',
        DeviceIds=[
            'string',
        ]
    )
    
  :type TrackerName: string
  :param TrackerName: **[REQUIRED]** 

    The tracker resource retrieving the device position.

    

  
  :type DeviceIds: list
  :param DeviceIds: **[REQUIRED]** 

    Devices whose position you want to retrieve.

     

    
    * For example, for two devices: ``device-ids=DeviceId1&device-ids=DeviceId2``
    

    

  
    - *(string) --* 

    

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

    
    ::

      {
          'Errors': [
              {
                  'DeviceId': 'string',
                  'Error': {
                      'Code': 'AccessDeniedError'|'ConflictError'|'InternalServerError'|'ResourceNotFoundError'|'ThrottlingError'|'ValidationError',
                      'Message': 'string'
                  }
              },
          ],
          'DevicePositions': [
              {
                  'DeviceId': 'string',
                  'SampleTime': datetime(2015, 1, 1),
                  'ReceivedTime': datetime(2015, 1, 1),
                  'Position': [
                      123.0,
                  ],
                  'Accuracy': {
                      'Horizontal': 123.0
                  },
                  'PositionProperties': {
                      'string': 'string'
                  }
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Errors** *(list) --* 

        Contains error details for each device that failed to send its position to the tracker resource.

        
        

        - *(dict) --* 

          Contains error details for each device that didn't return a position.

          
          

          - **DeviceId** *(string) --* 

            The ID of the device that didn't return a position.

            
          

          - **Error** *(dict) --* 

            Contains details related to the error code.

            
            

            - **Code** *(string) --* 

              The error code associated with the batch request error.

              
            

            - **Message** *(string) --* 

              A message with the reason for the batch request error.

              
        
      
    
      

      - **DevicePositions** *(list) --* 

        Contains device position details such as the device ID, position, and timestamps for when the position was received and sampled.

        
        

        - *(dict) --* 

          Contains the device position details.

          
          

          - **DeviceId** *(string) --* 

            The device whose position you retrieved.

            
          

          - **SampleTime** *(datetime) --* 

            The timestamp at which the device's position was determined. Uses `ISO 8601 <https://www.iso.org/iso-8601-date-and-time-format.html>`__ format: ``YYYY-MM-DDThh:mm:ss.sssZ``.

            
          

          - **ReceivedTime** *(datetime) --* 

            The timestamp for when the tracker resource received the device position in `ISO 8601 <https://www.iso.org/iso-8601-date-and-time-format.html>`__ format: ``YYYY-MM-DDThh:mm:ss.sssZ``.

            
          

          - **Position** *(list) --* 

            The last known device position.

            
            

            - *(float) --* 
        
          

          - **Accuracy** *(dict) --* 

            The accuracy of the device position.

            
            

            - **Horizontal** *(float) --* 

              Estimated maximum distance, in meters, between the measured position and the true position of a device, along the Earth's surface.

              
        
          

          - **PositionProperties** *(dict) --* 

            The properties associated with the position.

            
            

            - *(string) --* 
              

              - *(string) --* 
        
      
      
    
  
  **Exceptions**
  
  *   :py:class:`LocationService.Client.exceptions.InternalServerException`

  
  *   :py:class:`LocationService.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`LocationService.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`LocationService.Client.exceptions.ValidationException`

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

  