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

Send position

 

Service version: 1
Last edit: 2019.09.18

On this page

Purpose

This endpoint is used to send the position of the Object.

Request data

HTTPS method: POST

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/positions?key=Your_API_Key

curl command

curl -XPOST "Content-type: application/json" -d
'{
   "type": "Feature",
   "geometry": {
     "type": "Point",
     "coordinates": [
       longitude,
       latitude,
       altitude
     ]
   },
   "object": "<object_uuid>"
 }'
'https://baseURL/locationHistory/versionNumber/history/positions?key=Your_API_Key'

POST Request body (JSON)

{
  "type": "Feature",
  "geometry": {
    "type": "Point",
    "coordinates": [
      longitude,
      latitude,
      altitude
    ]
  },
  "object": "<object_uuid>"
}

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.
Optional parameters
This endpoint does not have any optional parameters.

Request fields

Primary fields
Field Description
type
string
In the current version this is always "Feature".
geometry{}
object
GeoJSON Point
object
UUID
The UUID of an object for which a position will be saved.
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.

▲ Return to top

Response data

HTTP Response codes

Code Meaning and possible causes
201 Created
403 Forbidden: No consent for storing historical data for the provided key.
404 Not found: No such object.

▲ Return to top

Examples

Request URL POST

https://api.tomtom.com/locationHistory/1/history/positions?key=Your_API_Key

POST Request body

{
  "geometry": {
    "type": "Point",
    "coordinates": [
      5.068704,
      52.364897,
      0.0
    ]
  },
  "object": "cf6eae04-bd5e-4220-ae02-8151e1e8e34f"
}

▲ Return to top

You are here