HOSLogs

  • This method returns the latest, most up-to-date HOS (Hours of Service) log details.
  • Returns the following required HOS data:
    1. sourceId
    2. driverSourceId
    3. vehicle
    4. driver
    5. status
    6. startedAt (UTC timestamp)
    7. endedAt (UTC timestamp)

Use Case

  • Use to query HOS logs for vehicles and drivers (status + started/ended time).

Request URL

Use an HTTP GET request to obtain HOS logs:

[GET] https://secure.trackyourtruck.com/WebApi/api/v2.2/GetHOSLogs

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.

Request Parameters

The Request should contain the following parameters:

Parameter Name Description Value Format Example
FromDate Beginning date for your query* YYYY-MM-DD 2026-05-19
ToDate Ending date for your query* YYYY-MM-DD 2026-05-19
DriverId (Optional) Filter by a specific driver text zachf
PageNumber (Optional) Page number to return. Default: 1 numeric 1
PageSize (Optional) Number of records per page. Default: configured server value (100). Max: 1000 numeric 100

Request Example

Below is the GetHOSLogs request API examples:


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

var queryParams = new Dictionary<string, string>
{
    { "FromDate", "2026-05-19" },
    { "ToDate", "2026-05-19" },
    { "DriverId", "zachf" },
    { "PageNumber", "1" },
    { "PageSize", "100" }
};

var queryString = string.Join("&", queryParams.Select(x => $"{x.Key}={Uri.EscapeDataString(x.Value)}"));
var response = await client.GetAsync($"https://secure.trackyourtruck.com/WebApi/api/v2.2/GetHOSLogs?{queryString}");
var responseString = await response.Content.ReadAsStringAsync();
// responseString will contain the response in JSON format
$.ajax({
    beforeSend: function(xhrObj){
        xhrObj.setRequestHeader("Authorization","Bearer YOUR_API_TOKEN");
    },
    type: "GET",
    url: "https://secure.trackyourtruck.com/WebApi/api/v2.2/GetHOSLogs",
    data: {
        FromDate: "2026-05-19",
        ToDate: "2026-05-19",
        DriverId: "zachf",
        PageNumber: 1,
        PageSize: 100
    },
    dataType: "json",
    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",
    "pagination": {
        "PageNumber": 1,
        "PageSize": 100,
        "TotalRecords": 1250,
        "TotalPages": 13,
        "HasMore": true
    },
    "Results": [
        {
            "sourceId": "29980",
            "driverSourceId": "563",
            "status": "Driving",
            "driver": "Ava Morales",
            "vehicle": "Blue Runner",
            "startedAt": "2025-01-06T03:24:53.000Z",
            "remarks": [
                {
                    "notes": "Odometer: 161187"
                }
            ],
            "endedAt": "2025-01-06T03:24:53.000Z",
            "location": {
                "longitude": -122.4194155,
                "latitude": 37.7749295
            }
        }
    ]
}

Test

Test the HOSLogs using your AccessToken by entering it below:

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