DriverList

  • This method contains the latest, most up-to-date driver list details
  • Returns the following required insurance data:
    1. sourceId (The ID used to represent the driver in the TYT system)
    2. status
    3. firstName
    4. middleName
    5. lastName
    6. email
    7. phone
    8. license.state
    9. license.number
    10. createdAt (UTC timestamp)
    11. updatedAt (UTC timestamp)

Use Case

  • Use to query driver details and licensing information

Use an HTTP GET request to obtain your list of drivers:

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

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.

Create DriverList Object

Below is the DriverList request API examples:


var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization","Bearer YOUR_API_TOKEN")
var response = await client.GetAsync("https://secure.trackyourtruck.com/WebApi/api/v2.2/DriverList");
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/DriverList",
    dataType: "json",
    success: function(data){
        //data object will contain the result as a JSON object
    }
});

Sample DriverList Object

$.ajax({
    beforeSend: function(xhrObj){
        xhrObj.setRequestHeader("Authorization","Bearer YOUR_API_TOKEN");
    },
    type: "GET",
    url: "https://secure.trackyourtruck.com/WebApi/api/v2.2/DriverList",
    dataType: "json",
    success: function(data){
        //data object will contain the result as a JSON object
    }
});

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": "123456789",
            "status": "active",
            "firstName": "Mike",
            "middleName": "Bryan",
            "lastName": "Miller",
            "email": "driver@example.com",
            "phone": "+19058084567",
            "license": {
                "state": "TN",
                "number": "123-456-789-0"
            },
            "createdAt": "2023-11-07T11:31:56Z",
            "updatedAt": "2023-11-07T11:31:56Z"
        },
        {
            "sourceId": "987654321",
            "status": "inactive",
            "firstName": "Sara",
            "middleName": "Lee",
            "lastName": "Johnson",
            "email": "sara.johnson@example.com",
            "phone": "+12125551234",
            "license": {
                "state": "CA",
                "number": "A1234567"
            },
            "createdAt": "2023-09-15T14:20:10Z",
            "updatedAt": "2023-11-01T09:05:30Z"
        }
    ]
}

Test

Test the DriverList using your AccessToken by entering it below:

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