Camera Events

  • This method returns camera event media for a vehicle within a date range.
  • Returns following information:
    • VehicleId
    • VehicleName
    • Media list (single array)
  • Each item in Media contains:
    • Type (Image / Video)
    • Url
    • Camera
    • EventTime (formatted text)
    • Event
    • PosterUrl (optional, for videos if available)

Use Case

  • Use this query to obtain the list of camera event media (images + videos) for a vehicle.

Use an HTTP POST request to obtain the Camera Events list:

[POST] https://secure.trackyourtruck.com/WebApi/api/v2.2/camera-events

The request header should contain the API Token obtained from the authentication process. Get Access Token.

Header Name Description
Authorization API Token obtained from the authentication process.

Request Parameters

The request should contain the following parameters:

Parameter Name Description Value Format Example
VehicleId (Optional) Filter by a specific VehicleID. numeric 825
FromDateTime Beginning Date/Time for your query. MM/dd/yyyy hh:mm tt 06/23/2024 12:00 AM
ToDateTime Ending Date/Time for your query. MM/dd/yyyy hh:mm tt 07/03/2024 11:59 PM

Create Camera Events Object

Below is the Camera Events request API examples:


var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization","Bearer YOUR_API_TOKEN");

var values = new Dictionary<string, string>
{
    { "VehicleId", "845" },
    { "FromDateTime", "06/23/2024 12:00 AM" },
    { "ToDateTime", "07/03/2024 11:59 PM" }
};

var content = new FormUrlEncodedContent(values);

var response = await client.PostAsync("https://secure.trackyourtruck.com/WebApi/api/v2.2/camera-events", content);
var responseString = await response.Content.ReadAsStringAsync();
// responseString will contain the result in JSON format
$.ajax({
    beforeSend: function(xhrObj){
        xhrObj.setRequestHeader("Authorization","Bearer YOUR_API_TOKEN");
    },
    type: "POST",
    url: "https://secure.trackyourtruck.com/WebApi/api/v2.2/camera-events",
    dataType: "json",
    data:{
        VehicleId: "845",
        FromDateTime : "06/23/2024 12:00 AM",
        ToDateTime: "07/03/2024 11:59 PM"
    },
    success: function(data){
        // data object will contain the result as a JSON object
    }
});

Sample Response

A successful request will return the following JSON result:

{
    "StatusCode": "200",
    "Message": "OK",
    "Data": [
        {
            "VehicleId": 28722,
            "VehicleName": "24/7-SmartWitness-CP2-2256",
            "Media": [
                {
                    "Type": "Image",
                    "Url": "https://...jpg",
                    "Camera": "Forward Facing",
                    "EventTime": "2025-08-04T14:53:55.000Z",
                    "Event": "Shock"
                },
                {
                    "Type": "Video",
                    "Url": "https://...mp4",
                    "Camera": "Forward Facing",
                    "PosterUrl": "https://...jpg",
                    "EventTime": "2025-08-04T14:53:55.000Z",
                    "Event": "Shock"
                }
            ]
        }
    ]
}

Test

Test the Camera Events API using your AccessToken by entering it below:

Clicking the test button will send a request to the TYT API and display the result below.