Sorry, you need to enable JavaScript to visit this website.

Last position

 

Service version: 1
Last edit: 2019.09.18

On this page

Purpose

This endpoint requests an object's most recent position.

If consent is given, the Geofencing API can also provide locations that will be available through this endpoint.

Request data

HTTPS method: GET

URL format

For ease of viewing and identification:

  • Required constants and parameters are shown in bold text.
  • Optional parameters are shown in plain text.
https://baseURL/locationHistory/versionNumber/history/position/objectId?key=Your_API_Key

curl command

curl 'https://baseURL/locationHistory/versionNumber/history/position/objectId?key=Your_API_Key'

Request parameters

The following table describes the parameters that can be used in a Request.

  • Required parameters must be used or the call will fail.
  • Optional parameters may be used.
  • If there is a default value that will be assumed when an optional parameter is not used, it is shown in the table.
  • The order of Request parameters is not important.
Required parameters
Parameter Description
baseURL
string
The base URL for calling the API.
Value: api.tomtom.com
versionNumber
string
Service version.
Value: 1
key
string
An API Key valid for the requested service.
Value: Your valid API Key.
objectId
string
Object UUID for which the report is requested.
Value: A UUID.
Optional parameters
This endpoint does not have any optional parameters.

▲ Return to top

Response data

Response body

The following JSON code block demonstrates a successful Response from the API server.

{
  "summary": {
    "id": "object_id",
    "name": "object_name"
  },
  "objectState": {
    "type": "Feature",
    "geometry": {
      "type": "Point",
      "coordinates": [longitude, latitude, altitude]
    },
    "estimatedSpeed": speed_value,
    "estimatedDirection": azimuth,
    "timestamp": "timestamp with time zone"
  }
}

Response fields

The following table describes all of the Response fields.

Primary fields
Field Description
summary{}
object
A short summary about the requested object.
objectState{}
object
Contains information about the current state of the requested object.
summary{} object
Field Description
id
string
UUID of an object for which this Response is generated.
name
string
Name of an object for which this Response is generated.
objectState{} object
Field Description
type
string
In the current version this is always "Feature".
geometry{}
object
Object's position.
estimatedSpeed
float
Estimated speed of an object in the given time. Presented in km/h.
estimatedDirection
float
Estimated direction presented as a north-based azimuth. Presented in degrees.
timestamp
float
Recorded time as timestamp (ISO 8601 format).
geometry{} object
Field Description
type
string
Type of geometry. In the current version this is always "Point".
coordinates[]
array(double)
Coordinates of the point in the form of an array containing (in this order): longitude, latitude,
altitude.

HTTP Response codes

Code Meaning & possible causes
200 OK
404 Not found:

  • No such object.
  • No position has been sent for object 'OBJECT_ID'.

▲ Return to top

Examples

Get details of the current position of the 'Support car 1' object (id: cfde72d8-4b9f-4f6d-83c8-87ae0465fd5d)

Request URL GET

https://api.tomtom.com/locationHistory/1/history/position/cfde72d8-4b9f-4f6d-83c8-87ae0465fd5d/position?key=Your_API_Key

Response body (JSON)

{
  "summary": {
    "id": "fde72d8-4b9f-4f6d-83c8-87ae0465fd5d",
    "name": "Support car 1"
  },
  "objectState": {
    "type": "Feature",
    "geometry": {
      "type": "Point",
      "coordinates": [4.8424672, 52.362239]
    },
    "estimatedSpeed": 59.4,
    "estimatedDirection": 170,
    "timestamp": "2019-06-04T13:30:00Z"
  }
}

▲ Return to top

You are here