Add new object
Decommission notice
Purpose
This endpoint creates a new 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 request format
https://{baseURL}/locationHistory/{versionNumber}/objects/object?key={Your_API_Key}&adminKey={Your_Admin_Key}curl command request format
curl -XPOST "Content-type: application/json" -d'{ "name": "object_name", "properties": { "key": "value" } }''https://{baseURL}/locationHistory/{versionNumber}/objects/object?key={Your_API_Key}&adminKey={Your_Admin_Key}'POST request body format (JSON)
{ "name": "object_name", "properties": { "key": "value" }}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 |
string | An Admin Key valid for the provided API Key. Value: Your valid |
Response data
Response body
{ "name": "object_name", "id": "object_id", "properties": { "key": "value" }}Response fields
The following table describes all of the fields that can appear in a response.
Primary fields | Description |
|---|---|
string | The name of the object. |
string | The UUID of the object. |
object | (Optional) The properties of the added object containing user-defined information. Its content varies between objects. |
Response codes
Code | Meaning & possible causes |
|---|---|
| Created |
| Bad request:
|
| Forbidden:
|
Example
Add a new object.
Request URL example
https://api.tomtom.com/locationHistory/1/objects/object?key={Your_API_Key}&adminKey={Your_Admin_Key}POST request body example
{ "name": "Support car 1", "properties": { "embeddedId": "EL 11111", "maxSpeedKmh": 70, "driver": "John Doe" }}Response body example
{ "name": "Support car 1", "id": "cfde72d8-4b9f-4f6d-83c8-87ae0465fd5d", "properties": { "embeddedId": "EL 11111", "maxSpeedKmh": 70, "driver": "John Doe" }}