Get fences transitions
Decommission notice
Purpose
This endpoint requests all transitions of multiple objects from a fence point of view.
Request data
HTTPS method: GET
- 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}/geofencing/{versionNumber}/transitions/fences/{fenceId}?key={Your_API_Key}&from={timestamp}&to={timestamp}&maxResults={integer}&pageNumber={integer}curl command request format
curl 'https://{baseURL}/geofencing/{versionNumber}/transitions/fences/{fenceId}?key={Your_API_Key}&from={timestamp}&to={timestamp}&maxResults={integer}&pageNumber={integer}'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.
- The maximum allowed time between provided timestamps is 24h.
Required parameters | Description |
|---|---|
| The base URL for calling the API. |
| Service version. |
| An API Key valid for the requested service. |
| A fence UUID for which a transition history is requested. |
| An Admin Key valid for the provided API Key. |
| The beginning date for a listing. |
Optional parameters | Description |
|---|---|
| End date for the listing. |
| Maximum number of items returned in the response. |
| The number of the items page to be returned in the response. The maximum
number of elements on the page is equal to the maxResult value. |
Response data
Response body
The following JSON code block demonstrates a successful response from the API server.
{ "summary": { "name": "string", "id": "uuid_string", "from": "ISO8601_timestamp", "to": "ISO8601_timestamp" }, "transitions": { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ longitude_number, latitude_number, altitude_number ] }, "projectId": "uuid_string", "projectName": "string", "objectId": "uuid_string", "objectName": "string", "transitionType": "string", "recordedTransitionTime": "ISO8601_timestamp", "estimatedTransitionTime": "ISO8601_timestamp", "estimatedDwellTime": "number" } ] }, "resultInfo": { "maxResults": number, "pageNumber": number, "itemsCount": number }}Response fields
The following table describes all of the response fields.
Primary fields | |
|---|---|
Field | Description |
| Contains information about the fence’s transitions request. |
| Contains information about transitions. |
| Contains information about response paging. |
summary object | |
Field | Description |
| UUID of an object for which this report is generated. |
| Name of an object for which this report is generated. |
| Timestamp (ISO 8601 format) marking the start of a period the report is generated for. |
| Timestamp (ISO 8601 format) marking the end of a period the report is generated for. |
transitions object | |
Field | Description |
| In the current implementation this is always “FeatureCollection”. |
| Array of historical transitions. |
event object | |
Field | Description |
| In the current version this is always “Feature”. |
| Estimated transition point. GeoJSON Point. |
| UUID of a project for which a transition has been recorded. |
| Name of a project for which a transition has been recorded. |
| UUID of an object for which a transition has been recorded. |
| Name of an object for which a transition has been recorded. |
| Transition type: “ENTER”, “LEAVE”, or “DWELL”. |
| Recorded time as a timestamp (ISO 8601 format). |
| Estimated transition time as a timestamp (ISO 8601 format). |
| Estimated dwell time (in seconds) inside the fence before this
transition occurred. |
geometry object | |
Field | Description |
| In the current version this is always “Point”. |
| Coordinates of the point in the form of an array containing (in this order): longitude, latitude. |
resultInfo object | |
Field | Description |
| Maximum number of items returned in the response. |
| Number of the items page to be returned in the response. Maximum number of elements on the page is equal to the maxResults value. |
| Number of returned items on the page. |
Response codes
Code | Meaning & possible causes |
|---|---|
| OK |
| Bad Request:
|
| Not found: No such fence. |
Example
Get transitions of the ‘Custom area’ fence ( id: e0b44791-bd14-48d5-829e-5d958d188f71 ).
URL request example
https://api.tomtom.com/geofencing/1/transitions/fences/e0b44791-bd14-48d5-829e-5d958d188f71?key={Your_API_Key}&from=2019-08-29T01:00:00&to=2019-08-29T23:00:00Response body example
{ "summary": { "name": "Support car 1", "id": "e0b44791-bd14-48d5-829e-5d958d188f71", "from": "2019-08-29T01:00:00", "to": "2019-08-29T23:00:00" }, "transitions": { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [5.257763, 52.161628] }, "projectId": "2e60fde8-f21d-4640-a7ed-69cd99783abc", "projectName": "Support car parking lots", "objectId": "abdbaaa6-2851-4946-90d1-41e676506a93", "objectName": "Support car", "transitionType": "LEAVE", "recordedTransitionTime": "2019-08-29T10:03:28", "estimatedTransitionTime": "2019-08-29T10:02:53", "estimatedDwellTime": "1123256" } ] }, "resultInfo": { "maxResults": 100, "pageNumber": 1, "itemsCount": 1 }}