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

***************************
get_device_position_history
***************************



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

  

  Retrieves the device position history from a tracker resource within a specified range of time.

   

  .. note::

    

    Device positions are deleted after 30 days.

    

  

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


  **Request Syntax**
  ::

    response = client.get_device_position_history(
        TrackerName='string',
        DeviceId='string',
        NextToken='string',
        StartTimeInclusive=datetime(2015, 1, 1),
        EndTimeExclusive=datetime(2015, 1, 1),
        MaxResults=123
    )
    
  :type TrackerName: string
  :param TrackerName: **[REQUIRED]** 

    The tracker resource receiving the request for the device position history.

    

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

    The device whose position history you want to retrieve.

    

  
  :type NextToken: string
  :param NextToken: 

    The pagination token specifying which page of results to return in the response. If no token is provided, the default page is the first page.

     

    Default value: ``null``

    

  
  :type StartTimeInclusive: datetime
  :param StartTimeInclusive: 

    Specify the start time for the position history in `ISO 8601 <https://www.iso.org/iso-8601-date-and-time-format.html>`__ format: ``YYYY-MM-DDThh:mm:ss.sssZ``. By default, the value will be 24 hours prior to the time that the request is made.

     

    Requirement:

     

    
    * The time specified for ``StartTimeInclusive`` must be before ``EndTimeExclusive``.
    

    

  
  :type EndTimeExclusive: datetime
  :param EndTimeExclusive: 

    Specify the end time for the position history in `ISO 8601 <https://www.iso.org/iso-8601-date-and-time-format.html>`__ format: ``YYYY-MM-DDThh:mm:ss.sssZ``. By default, the value will be the time that the request is made.

     

    Requirement:

     

    
    * The time specified for ``EndTimeExclusive`` must be after the time for ``StartTimeInclusive``.
    

    

  
  :type MaxResults: integer
  :param MaxResults: 

    An optional limit for the number of device positions returned in a single call.

     

    Default value: ``100``

    

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

    
    ::

      {
          'DevicePositions': [
              {
                  'DeviceId': 'string',
                  'SampleTime': datetime(2015, 1, 1),
                  'ReceivedTime': datetime(2015, 1, 1),
                  'Position': [
                      123.0,
                  ],
                  'Accuracy': {
                      'Horizontal': 123.0
                  },
                  'PositionProperties': {
                      'string': 'string'
                  }
              },
          ],
          'NextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

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

        Contains the position history details for the requested device.

        
        

        - *(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) --* 
        
      
      
    
      

      - **NextToken** *(string) --* 

        A pagination token indicating there are additional pages available. You can use the token in a following request to fetch the next set of results.

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

  