Get projects transitions
Purpose
This endpoint requests all transitions linked with fences in a project.
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/projects/{projectId}?key={Your_API_Key}&from={timestamp}&to={timestamp}&maxResults={integer}&pageNumber={integer}
curl command request format
curl 'https://{baseURL}/geofencing/{versionNumber}/transitions/projects/{projectId}?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. |
| An project 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 maxResults value. |
Response data
Response body
The following JSON code block demonstrates a successful response from the API server.
1{2 "summary": {3 "name": "string",4 "id": "uuid_string",5 "from": "ISO8601_timestamp",6 "to": "ISO8601_timestamp"7 },8 "transitions": {9 "type": "FeatureCollection",10 "features": [11 {12 "type": "Feature",13 "geometry": {14 "type": "Point",15 "coordinates": [16 longitude_number,17 latitude_number,18 altitude_number19 ]20 },21 "objectId": "uuid_string",22 "objectName": "string",23 "fenceId": "uuid_string",24 "fenceName": "string",25 "transitionType": "string",26 "recordedTransitionTime": "ISO8601_timestamp",27 "estimatedTransitionTime": "ISO8601_timestamp",28 "estimatedDwellTime": "number"29 }30 ]31 },32 "resultInfo": {33 "maxResults": number,34 "pageNumber": number,35 "itemsCount": number36 }37}
Response fields
The following table describes all of the response fields.
Primary fields | |
---|---|
Field | Description |
| Contains information about the project's transitions request. |
| Contains information about transitions. |
| Contains information about response paging. |
summary object | |
Field | Description |
| UUID of a project for which this report is generated. |
| Name of a project 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 an object for which a transition has been recorded. |
| Name of an object for which a transition has been recorded. |
| UUID of a fence for which a transition has been recorded. |
| Name of a fence 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 maxResult value. |
| Number of returned items on the page. |
Response codes
Code | Meaning & possible causes |
---|---|
| OK |
| Bad Request:
|
| Not found: No such project. |
Example
Get transitions for the 'Support car parking lots' project (id: cfde72d8-4b9f-4f6d-83c8-87ae0465fd5d).
URL request example
https://api.tomtom.com/geofencing/1/transitions/projects/cfde72d8-4b9f-4f6d-83c8-87ae0465fd5d?key={Your_API_Key}&from=2019-08-29T01:00:00&to=2019-08-29T23:00:00
Response body example
1{2 "summary": {3 "name": "Support car parking lots",4 "id": "cfde72d8-4b9f-4f6d-83c8-87ae0465fd5d",5 "from": "2019-08-29T01:00:00",6 "to": "2019-08-29T23:00:00"7 },8 "transitions": {9 "type": "FeatureCollection",10 "features": [11 {12 "type": "Feature",13 "geometry": {14 "type": "Point",15 "coordinates": [5.257763, 52.161628]16 },17 "objecId": "2e60fde8-f21d-4640-a7ed-69cd99783abc",18 "objectName": "Support car I",19 "fenceId": "e5f3615e-62c8-4454-957b-dc577bb3914b",20 "fenceName": "Europe-29-Netherlands",21 "transitionType": "LEAVE",22 "recordedTransitionTime": "2019-08-29T10:03:28",23 "estimatedTransitionTime": "2019-08-29T10:02:53",24 "estimatedDwellTime": "1122719"25 },26 {27 "type": "Feature",28 "geometry": {29 "type": "Point",30 "coordinates": [5.257872, 52.161737]31 },32 "objecId": "ddbeb555-787d-48f1-a59c-158b40a3df8e",33 "objectName": "Support car II",34 "fenceId": "e5f3615e-62c8-4454-957b-dc577bb3914b",35 "fenceName": "Europe-29-Netherlands",36 "transitionType": "ENTER",37 "recordedTransitionTime": "2019-08-29T14:31:34",38 "estimatedTransitionTime": "2019-08-29T14:30:58",39 "estimatedDwellTime": "0"40 }41 ]42 },43 "resultInfo": {44 "maxResults": 100,45 "pageNumber": 1,46 "itemsCount": 247 }48}