HistoricalSafetyEvents
- This method returns historical safety events.
-
Returns the following required safety data:
- sourceId
- type
- vehicle
- startedAt
- driver
- startLocation.longitude
- startLocation.latitude
- endedAt
- endLocation.longitude
- endLocation.latitude
- stats.maximumSpeed
- stats.gForceForwardBackward
- stats.gForceSideToSide
- stats.heading
- cameraMedia.frontFacing.available
- cameraMedia.frontFacing.Media[].Type
- cameraMedia.frontFacing.Media[].Url
- cameraMedia.frontFacing.Media[].EventTime
- cameraMedia.frontFacing.Media[].PosterUrl
- cameraMedia.rearFacing.available
- cameraMedia.rearFacing.Media[].Type
- cameraMedia.rearFacing.Media[].Url
- cameraMedia.rearFacing.Media[].EventTime
- cameraMedia.rearFacing.Media[].PosterUrl
Use Case
- Use to retrieve safety events for a vehicle and date range.
Request URL
Use an HTTP POST request to obtain historical safety events:
[POST] https://secure.trackyourtruck.com/WebApi/api/v2.2/HistoricalSafetyEvents
Request Header
The request header should contain the API Access Token obtained from the authentication process. Get Access Token.
| Header Name | Description |
|---|---|
| Authorization | Access Token obtained from the 1st step's authentication process. |
Sample Response
A successful request will return the following JSON result:
{
"StatusCode": "200",
"Message": "OK",
"pagination": {
"PageNumber": 1,
"PageSize": 100,
"TotalRecords": 1250,
"TotalPages": 13,
"HasMore": true
},
"Results": [
{
"sourceId": "3685501941",
"type": "harsh_turn",
"vehicle": "29980",
"startedAt": "2026-03-13T12:10:18.000Z",
"driver": "",
"startLocation": {
"longitude": -79.24167,
"latitude": 37.36114
},
"endedAt": "2026-03-13T12:10:18.000Z",
"endLocation": {
"longitude": -79.24167,
"latitude": 37.36114
},
"stats": {
"maximumSpeed": 21.875,
"gForceForwardBackward": 0,
"gForceSideToSide": 0,
"heading": 43
},
"cameraMedia": {
"frontFacing": {
"available": true,
"Media": [
{
"Type": "Video",
"Url": "https://...mp4",
"EventTime": "2026-03-13T12:10:18.000Z",
"PosterUrl": "https://...jpg"
}
]
},
"rearFacing": {
"available": true,
"Media": [
{
"Type": "Video",
"Url": "https://...mp4",
"EventTime": "2026-03-13T12:10:18.000Z",
"PosterUrl": "https://...jpg"
}
]
}
}
}
]
}
Test
Test the HistoricalSafetyEvents using your AccessToken by entering it below:
Clicking the test button will send a request to the TYT API and display the result below.