Send position
Decommission notice
Important note
Purpose
This endpoint is used to send the position of the Object.
Request data
HTTPS method: POST
- Constants and parameters enclosed in curly brackets { } must be replaced with their values.
- Please see the following Request parameters section with the required and optional parameters tables for their values. The generic request format is as follows.
URL format
https://{baseURL}/locationHistory/{versionNumber}/history/positions?key={Your_API_Key}curl command request format
curl -XPOST "Content-type: application/json" -d'{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [ longitude, latitude, altitude ] }, "object": "object_uuid", "timestamp": "YYYY-MM-DDThh:mm:ss" }''https://{baseURL}/locationHistory/{versionNumber}/history/positions?key={Your_API_Key}'POST request body
{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [ longitude, latitude, altitude ] }, "object": "object_uuid", "timestamp": "YYYY-MM-DDThh:mm:ss"}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.
- The order of request parameters is not important.
Note: There are no optional parameters in this endpoint.
Required parameters | Description |
|---|---|
string | The base URL for calling the API. Value: |
string | Service version. Value: |
string | An API Key valid for the requested service. Value: Your valid |
POST body request fields
Primary fields | |
|---|---|
Field | Description |
string | In the current version this is always “Feature”. |
object | GeoJSON Point |
UUID | The UUID of an object for which a position will be saved. |
string | The date and time of the position being recorded by the user. Default value: |
geometry object | |
Field | Description |
string | Type of geometry. In the current version this is always “Point”. |
array (double) | Coordinates of the point in the form of an array containing (in this order): longitude, latitude, altitude. Altitude is optional. |
Response data
Response body
The response body is empty.
Response codes
Code | Meaning & possible causes |
|---|---|
| Created |
| Bad request :
|
| Forbidden : No consent for storing historical data for the provided key. |
| Not found : No such object. |
Example
Send a position.
POST request example
https://api.tomtom.com/locationHistory/1/history/positions?key={Your_API_Key}POST request body example
{ "geometry": { "type": "Point", "coordinates": [5.068704, 52.364897, 0.0] }, "object": "cf6eae04-bd5e-4220-ae02-8151e1e8e34f"}